From 6210bbb10c60a73311477b8035330b6a978c8e5e Mon Sep 17 00:00:00 2001 From: John Wiseheart Date: Mon, 3 Sep 2018 12:58:45 +0100 Subject: [PATCH 1/6] Add tslint-playground to docs --- .github/ISSUE_TEMPLATE/bug_report.md | 10 +++- README.md | 90 ++++++++++++++-------------- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 35d96c2937d..9b77c6fa90b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,9 +6,13 @@ about: Report a bug in TSLint ### Bug Report -- __TSLint version__: -- __TypeScript version__: -- __Running TSLint via__: (pick one) CLI / Node.js API / VSCode / grunt-tslint / Atom / Visual Studio / etc +- **TSLint version**: +- **TypeScript version**: +- **Running TSLint via**: (pick one) CLI / Node.js API / VSCode / grunt-tslint / Atom / Visual Studio / etc + +#### Reproduction using [TSLint Playground](https://palantir.github.io/tslint-playground/) + +Bug reports for rules should include a reproduction using the tslint-playground website. Click the `Save to URL` button and paste the URL here. #### TypeScript code being linted diff --git a/README.md b/README.md index 5d58075f297..1d5511deca8 100644 --- a/README.md +++ b/README.md @@ -2,60 +2,61 @@ [![Downloads](http://img.shields.io/npm/dm/tslint.svg)](https://npmjs.org/package/tslint) [![Circle CI](https://circleci.com/gh/palantir/tslint.svg?style=svg)](https://circleci.com/gh/palantir/tslint) -TSLint -====== +# TSLint TSLint is an extensible static analysis tool that checks [TypeScript](https://github.com/Microsoft/TypeScript) code for readability, maintainability, and functionality errors. It is widely supported across modern editors & build systems and can be customized with your own lint rules, configurations, and formatters. TSLint supports: -- an extensive set of core rules -- custom lint rules -- custom formatters (failure reporters) -- inline disabling and enabling of rules with comment flags in source code -- configuration presets (`tslint:latest`, `tslint-react`, etc.) and plugin composition -- automatic fixing of formatting & style violations -- integration with [MSBuild](https://github.com/joshuakgoldberg/tslint.msbuild), [Grunt](https://github.com/palantir/grunt-tslint), [Gulp](https://github.com/panuhorsmalahti/gulp-tslint), [Atom](https://github.com/AtomLinter/linter-tslint), [Eclipse](https://github.com/palantir/eclipse-tslint), [Emacs](http://flycheck.org), [Sublime](https://packagecontrol.io/packages/SublimeLinter-contrib-tslint), [Vim](https://github.com/scrooloose/syntastic), [Visual Studio 2015](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebAnalyzer), [Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=RichNewman.TypeScriptAnalyzer), [Visual Studio code](https://marketplace.visualstudio.com/items?itemName=eg2.tslint), [WebStorm](https://www.jetbrains.com/webstorm/help/tslint.html) and [more](https://palantir.github.io/tslint/usage/third-party-tools/) +- an extensive set of core rules +- custom lint rules +- custom formatters (failure reporters) +- inline disabling and enabling of rules with comment flags in source code +- configuration presets (`tslint:latest`, `tslint-react`, etc.) and plugin composition +- automatic fixing of formatting & style violations +- integration with [MSBuild](https://github.com/joshuakgoldberg/tslint.msbuild), [Grunt](https://github.com/palantir/grunt-tslint), [Gulp](https://github.com/panuhorsmalahti/gulp-tslint), [Atom](https://github.com/AtomLinter/linter-tslint), [Eclipse](https://github.com/palantir/eclipse-tslint), [Emacs](http://flycheck.org), [Sublime](https://packagecontrol.io/packages/SublimeLinter-contrib-tslint), [Vim](https://github.com/scrooloose/syntastic), [Visual Studio 2015](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebAnalyzer), [Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=RichNewman.TypeScriptAnalyzer), [Visual Studio code](https://marketplace.visualstudio.com/items?itemName=eg2.tslint), [WebStorm](https://www.jetbrains.com/webstorm/help/tslint.html) and [more](https://palantir.github.io/tslint/usage/third-party-tools/) -Installation & Usage ------------- +## Installation & Usage Please refer to the full installation & usage documentation on the [TSLint website](https://palantir.github.io/tslint/). There, you'll find information about -- [configuration](https://palantir.github.io/tslint/usage/configuration/), -- [core rules](https://palantir.github.io/tslint/rules/), -- [core formatters](https://palantir.github.io/tslint/formatters/), and -- [customization of TSLint](https://palantir.github.io/tslint/develop/custom-rules/). -- [inline disabling and enabling of rules with comment flags](https://palantir.github.io/tslint/usage/rule-flags/) -Custom Rules & Plugins ------------- +- [configuration](https://palantir.github.io/tslint/usage/configuration/), +- [core rules](https://palantir.github.io/tslint/rules/), +- [core formatters](https://palantir.github.io/tslint/formatters/), and +- [customization of TSLint](https://palantir.github.io/tslint/develop/custom-rules/). +- [inline disabling and enabling of rules with comment flags](https://palantir.github.io/tslint/usage/rule-flags/) + +## TSLint Playground + +There is a sandbox environment for TSLint at [palantir.github.io/tslint-playground](https://palantir.github.io/tslint-playground/), which can be used to test rules and see how tslint works. Issues can be files against `tslint-playground` [here](https://github.com/palantir/tslint-playground). + +## Custom Rules & Plugins #### Custom rule sets from Palantir -- [tslint-react](https://github.com/palantir/tslint-react) - Lint rules related to React & JSX. -- [tslint-blueprint](https://github.com/palantir/tslint-blueprint) - Lint rules to enforce best practices with [blueprintjs libraries](https://github.com/palantir/blueprint) +- [tslint-react](https://github.com/palantir/tslint-react) - Lint rules related to React & JSX. +- [tslint-blueprint](https://github.com/palantir/tslint-blueprint) - Lint rules to enforce best practices with [blueprintjs libraries](https://github.com/palantir/blueprint) #### Custom rule sets from the community If we don't have all the rules you're looking for, you can either write your own [custom rules](https://palantir.github.io/tslint/develop/custom-rules/) or use rules implementations developed by the community. The repos below are a good source of custom rules: -- [ESLint rules for TSLint](https://github.com/buzinas/tslint-eslint-rules) - Improve your TSLint with the missing ESLint Rules -- [tslint-microsoft-contrib](https://github.com/Microsoft/tslint-microsoft-contrib) - A set of TSLint rules used on some Microsoft projects -- [codelyzer](https://github.com/mgechev/codelyzer) - A set of tslint rules for static code analysis of Angular TypeScript projects -- [vrsource-tslint-rules](https://github.com/vrsource/vrsource-tslint-rules) -- [tslint-immutable](https://github.com/jonaskello/tslint-immutable) - TSLint rules to disable mutation in TypeScript -- [tslint-consistent-codestyle](https://github.com/ajafff/tslint-consistent-codestyle) - TSLint rules to enforce consistent code style in TypeScript -- [tslint-sonarts](https://github.com/SonarSource/SonarTS) - Bug-finding rules based on advanced code models to spot hard to find errors in TypeScript -- [tslint-clean-code](https://github.com/Glavin001/tslint-clean-code) - A set of TSLint rules inspired by the Clean Code handbook -- [rxjs-tslint-rules](https://github.com/cartant/rxjs-tslint-rules) - TSLint rules for RxJS +- [ESLint rules for TSLint](https://github.com/buzinas/tslint-eslint-rules) - Improve your TSLint with the missing ESLint Rules +- [tslint-microsoft-contrib](https://github.com/Microsoft/tslint-microsoft-contrib) - A set of TSLint rules used on some Microsoft projects +- [codelyzer](https://github.com/mgechev/codelyzer) - A set of tslint rules for static code analysis of Angular TypeScript projects +- [vrsource-tslint-rules](https://github.com/vrsource/vrsource-tslint-rules) +- [tslint-immutable](https://github.com/jonaskello/tslint-immutable) - TSLint rules to disable mutation in TypeScript +- [tslint-consistent-codestyle](https://github.com/ajafff/tslint-consistent-codestyle) - TSLint rules to enforce consistent code style in TypeScript +- [tslint-sonarts](https://github.com/SonarSource/SonarTS) - Bug-finding rules based on advanced code models to spot hard to find errors in TypeScript +- [tslint-clean-code](https://github.com/Glavin001/tslint-clean-code) - A set of TSLint rules inspired by the Clean Code handbook +- [rxjs-tslint-rules](https://github.com/cartant/rxjs-tslint-rules) - TSLint rules for RxJS -Development ------------ +## Development Prerequisites: -- `node` v7+ -- `yarn` v1.0+ +- `node` v7+ +- `yarn` v1.0+ #### Quick Start @@ -66,15 +67,14 @@ yarn compile yarn test ``` -Creating a new release ----------------------- - -1. Bump the version number in `package.json` and `src/linter.ts` -2. Add release notes in `CHANGELOG.md` - - Use `./scripts/generate-changelog.js` (after building it with `tsc -p scripts`) to generate the changelog diff. This script expects a [Github.com personal access token](https://github.com/settings/tokens) to exist at `~/github_token.txt` with "repo" permissions. -4. Commit with message `Prepare release ` -5. Push your branch to GitHub and make a PR -6. Once your PR is merged, wait for the tests to pass on CircleCI for develop -7. Create a "Release" on GitHub with the proper tag version and notes from the changelog. - - The tag should be identical to the version in `package.json` -8. Run `yarn run publish:local` +## Creating a new release + +1. Bump the version number in `package.json` and `src/linter.ts` +2. Add release notes in `CHANGELOG.md` + - Use `./scripts/generate-changelog.js` (after building it with `tsc -p scripts`) to generate the changelog diff. This script expects a [Github.com personal access token](https://github.com/settings/tokens) to exist at `~/github_token.txt` with "repo" permissions. +3. Commit with message `Prepare release ` +4. Push your branch to GitHub and make a PR +5. Once your PR is merged, wait for the tests to pass on CircleCI for develop +6. Create a "Release" on GitHub with the proper tag version and notes from the changelog. + - The tag should be identical to the version in `package.json` +7. Run `yarn run publish:local` From 827d23031cfeab77cf29a1dcdd577902a4e47d56 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 15 Jun 2019 20:46:31 -0400 Subject: [PATCH 2/6] Review typos: caps, extra s --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d5511deca8..a2c822e5cd4 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Please refer to the full installation & usage documentation on the [TSLint websi ## TSLint Playground -There is a sandbox environment for TSLint at [palantir.github.io/tslint-playground](https://palantir.github.io/tslint-playground/), which can be used to test rules and see how tslint works. Issues can be files against `tslint-playground` [here](https://github.com/palantir/tslint-playground). +There is a sandbox environment for TSLint at [palantir.github.io/tslint-playground](https://palantir.github.io/tslint-playground/), which can be used to test rules and see how TSLint works. Issues can be filed against `tslint-playground` [here](https://github.com/palantir/tslint-playground). ## Custom Rules & Plugins From 31f95c683b35bb0f3e1008c01d1cdf7cee41d254 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 15 Jun 2019 20:47:08 -0400 Subject: [PATCH 3/6] Removed release creation section --- README.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/README.md b/README.md index a2c822e5cd4..a61b8ba0899 100644 --- a/README.md +++ b/README.md @@ -66,15 +66,3 @@ yarn yarn compile yarn test ``` - -## Creating a new release - -1. Bump the version number in `package.json` and `src/linter.ts` -2. Add release notes in `CHANGELOG.md` - - Use `./scripts/generate-changelog.js` (after building it with `tsc -p scripts`) to generate the changelog diff. This script expects a [Github.com personal access token](https://github.com/settings/tokens) to exist at `~/github_token.txt` with "repo" permissions. -3. Commit with message `Prepare release ` -4. Push your branch to GitHub and make a PR -5. Once your PR is merged, wait for the tests to pass on CircleCI for develop -6. Create a "Release" on GitHub with the proper tag version and notes from the changelog. - - The tag should be identical to the version in `package.json` -7. Run `yarn run publish:local` From b3047d0139759e15ce445a5df06859f8891e71ea Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 15 Jun 2019 20:48:07 -0400 Subject: [PATCH 4/6] Comment-ified bug report template --- .github/ISSUE_TEMPLATE/bug_report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9b77c6fa90b..6f24d6f69d5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,7 +12,9 @@ about: Report a bug in TSLint #### Reproduction using [TSLint Playground](https://palantir.github.io/tslint-playground/) + #### TypeScript code being linted From 4a2666df6342ab78d69f2ea8d94abcede443b4be Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 15 Jun 2019 20:51:33 -0400 Subject: [PATCH 5/6] Undid a few more master changes --- .github/ISSUE_TEMPLATE/bug_report.md | 8 ++++---- README.md | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6f24d6f69d5..062ee198d31 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,11 +6,11 @@ about: Report a bug in TSLint ### Bug Report -- **TSLint version**: -- **TypeScript version**: -- **Running TSLint via**: (pick one) CLI / Node.js API / VSCode / grunt-tslint / Atom / Visual Studio / etc +- __TSLint version__: +- __TypeScript version__: +- __Running TSLint via__: (pick one) CLI / Node.js API / VSCode / grunt-tslint / Atom / Visual Studio / etc -#### Reproduction using [TSLint Playground](https://palantir.github.io/tslint-playground/) +#### Reproduction using [TSLint Playground](https://palantir.github.io/tslint-playground)