From 7ea14aee8b91b1622d7aea8a7f65aba9fe0839b0 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 22 Jul 2022 13:53:05 -0400 Subject: [PATCH] chore(website): streamlined Getting Started docs (#5248) * chore(website): streamlined Getting Started docs * Fix: check-spelling; lint-markdown * Fixed remaining typed-linting issues * Apply suggestions from code review Co-authored-by: Brad Zacher * TSLINT_RULE_ALTERNATIVES.md * Code case * Remove prettier-ignore Co-authored-by: Brad Zacher --- .cspell.json | 3 +- _redirects | 4 + docs/README.md | 76 +- docs/development/architecture/PACKAGES.md | 2 +- .../linting/{CONFIGS.md => CONFIGURATIONS.md} | 36 +- docs/linting/MONOREPO.md | 82 -- docs/linting/README.md | 223 ------ docs/linting/TROUBLESHOOTING.md | 7 +- docs/linting/TYPED_LINTING.md | 21 +- docs/linting/{ => troubleshooting}/TSLINT.md | 10 +- docs/linting/typed-linting/MONOREPOS.md | 79 ++ packages/eslint-plugin/README.md | 2 +- packages/eslint-plugin/ROADMAP.md | 727 +---------------- .../eslint-plugin/TSLINT_RULE_ALTERNATIVES.md | 728 ++++++++++++++++++ packages/eslint-plugin/src/configs/README.md | 3 - packages/parser/README.md | 2 +- packages/website/docusaurusConfig.ts | 2 +- packages/website/sidebars/sidebar.base.js | 32 +- 18 files changed, 964 insertions(+), 1075 deletions(-) create mode 100644 _redirects rename docs/linting/{CONFIGS.md => CONFIGURATIONS.md} (61%) delete mode 100644 docs/linting/MONOREPO.md delete mode 100644 docs/linting/README.md rename docs/linting/{ => troubleshooting}/TSLINT.md (63%) create mode 100644 docs/linting/typed-linting/MONOREPOS.md create mode 100644 packages/eslint-plugin/TSLINT_RULE_ALTERNATIVES.md delete mode 100644 packages/eslint-plugin/src/configs/README.md diff --git a/.cspell.json b/.cspell.json index 4691cd152db..f1f863b5952 100644 --- a/.cspell.json +++ b/.cspell.json @@ -8,7 +8,7 @@ "**/*.{json,snap}", "**/**/CHANGELOG.md", "**/**/CONTRIBUTORS.md", - "**/**/ROADMAP.md", + "**/**/TSLINT_RULE_ALTERNATIVES.md", "**/coverage/**", "**/dist/**", "**/fixtures/**", @@ -88,6 +88,7 @@ "preact", "Premade", "prettier's", + "Quickstart", "recurse", "redeclaration", "redeclarations", diff --git a/_redirects b/_redirects new file mode 100644 index 00000000000..1b61a020ea0 --- /dev/null +++ b/_redirects @@ -0,0 +1,4 @@ +/docs/linting /docs +/docs/linting/type-linting /docs/linting/typed-linting +/docs/linting/monorepo /docs/linting/typed-linting/monorepos +/docs/linting/tslint /docs/linting/troubleshooting/tslint diff --git a/docs/README.md b/docs/README.md index dfac81e925a..9b9aecb54f5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,13 +1,79 @@ --- +id: getting-started title: Getting Started -sidebar_label: Getting Started slug: / --- -These docs will give you a quick overview of the project and all of its pieces, as well as provide guides to help you get set up. +## Quickstart -The docs are broken down into the following categories: +These steps will get you running ESLint with our recommended rules on your TypeScript code as quickly as possible. -- [I want to lint my TypeScript codebase.](./linting/README.md) +### Step 1: Installation -- [I want to develop an ESLint plugin in TypeScript.](./development/CUSTOM_RULES.md) +First, install the required packages for [ESLint](https://eslint.io), [TypeScript](https://typescriptlang.org), and this plugin: + +```bash npm2yarn +npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript +``` + +### Step 2: Configuration + +Next, create a `.eslintrc.cjs` config file in the root of your project, and populate it with the following: + +```js title=".eslintrc.cjs" +module.exports = { + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + root: true, +}; +``` + +:::info +If your project doesn't use ESM, naming the file as `.eslintrc.js` is fine. See [ESLint's Configuration Files docs](https://eslint.org/docs/user-guide/configuring/configuration-files) for more info. +::: + +### Step 3: Running ESLint + +Open a terminal to the root of your project and run the following command: + + + + +```bash +npx eslint . +``` + + + + +```bash +yarn eslint . +``` + + + + +ESLint will lint all TypeScript compatible files within the current folder, and will output the results to your terminal. + +## Details + +- You can read more about configuring ESLint [in their documentation on configuration](https://eslint.org/docs/user-guide/configuring). +- You can read more about the rules provided by ESLint [in their documentation on their rules](https://eslint.org/docs/rules/). +- You can read more about the rules provided by typescript-eslint in [our rules documentation](/rules). + +### Configuration Values + +- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) package you installed to parse your source files. + - This is required, or else ESLint will throw errors as it tries to parse TypeScript code as if it were regular JavaScript. +- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin)) package as a plugin. + - This allows you to use typescript-eslint's rules within your codebase. +- `extends: [ ... ]` tells ESLint that your config extends the given configurations. + - `eslint:recommended` is ESLint's inbuilt "recommended" config - it turns on a small, sensible set of rules which lint for well-known best-practices. + - `plugin:@typescript-eslint/recommended` is our "recommended" config - it's just like `eslint:recommended`, except it only turns on rules from our TypeScript-specific plugin. + +## Next Steps + +We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/TYPED_LINTING.md 'Visit the next page for a typed rules setup guide'). + +If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/TROUBLESHOOTING.md). diff --git a/docs/development/architecture/PACKAGES.md b/docs/development/architecture/PACKAGES.md index 461cc021812..f798e35b2e4 100644 --- a/docs/development/architecture/PACKAGES.md +++ b/docs/development/architecture/PACKAGES.md @@ -66,7 +66,7 @@ Any custom rules you write generally will be as well. [`@typescript-eslint/eslint-plugin-tslint`] is a separate ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. :::caution -**TSLint is deprecated.** It is in your best interest to migrate off it entirely. See [Linting > TSLint](../../linting/TSLINT.md). +**TSLint is deprecated.** It is in your best interest to migrate off it. See [Linting > Troubleshooting & FAQs > What About TSLint?](../../linting/troubleshooting/TSLINT.md). ::: [`@typescript-eslint/eslint-plugin-tslint`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint diff --git a/docs/linting/CONFIGS.md b/docs/linting/CONFIGURATIONS.md similarity index 61% rename from docs/linting/CONFIGS.md rename to docs/linting/CONFIGURATIONS.md index 659064c6901..de05a216ff8 100644 --- a/docs/linting/CONFIGS.md +++ b/docs/linting/CONFIGURATIONS.md @@ -1,9 +1,10 @@ --- id: configs -sidebar_label: Configurations title: Configurations --- +[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive base config for you, with the intention that you add the config and it gives you an opinionated setup. + ## Built-In Configurations `@typescript-eslint/eslint-plugin` includes built-in configurations you can extend from to pull in the recommended starting rules. @@ -11,6 +12,10 @@ title: Configurations With the exception of `strict`, all configurations are considered "stable". Rule additions and removals are treated as breaking changes and will only be done in major version bumps. +:::note +We recommend most packages extend from [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./TYPED_LINTING.md)). +::: + ### `eslint-recommended` This ruleset is meant to be used after extending `eslint:recommended`. @@ -60,7 +65,7 @@ Rules in this configuration are similarly useful to those in `recommended`. :::tip We recommend all TypeScript projects extend from this configuration, with the caveat that rules using type information take longer to run. -See [Linting with Type Information](/docs/linting/type-linting) for more details. +See [Linting with Type Information](/docs/linting/typed-linting) for more details. ::: ### `strict` @@ -89,4 +94,29 @@ See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configu ### Suggesting Configuration Changes -If you feel strongly that a specific rule should (or should not) be one of these configurations, please feel free to [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new/choose) along with a **detailed** argument explaining your reasoning. +If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning. + +## Prettier + +If you use [`prettier`](https://www.npmjs.com/package/prettier), there is also a helpful config to help ensure ESLint doesn't report on formatting issues that prettier will fix: [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier). + +Using this config by adding it to the end of your `extends`: + +```js title=".eslintrc.js" +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + // Add this line + 'prettier', + ], +}; +``` + +:::warning +**We strongly recommend you use Prettier or an equivalent**, not ESLint formatting rules. +See [this issue](https://github.com/typescript-eslint/typescript-eslint/issues/4907 'Issue: Docs: Add our opinion on delegating stylistic issues to a tool such as Prettier #4907') for more information. +::: diff --git a/docs/linting/MONOREPO.md b/docs/linting/MONOREPO.md deleted file mode 100644 index 4ec2df16136..00000000000 --- a/docs/linting/MONOREPO.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -id: monorepo -title: Monorepo Configuration -sidebar_label: Monorepo Configuration ---- - -If you're using a monorepo, these docs will help you figure out how to setup typed linting. -If you don't want to use typed linting, then you can stop here - you don't need to do anything special. - -The first question to answer is how are your `tsconfig.json` setup? You should have one of two setups: - -1. One `tsconfig.json` per package (and an optional one in the root) -2. One root `tsconfig.json` - -## One `tsconfig.json` per package (and an optional one in the root) - -Earlier in our docs on [typed linting](./TYPED_LINTING.md), we showed you how to setup a config for typed linting using the `parserOptions.project` option. This option accepts an array of relative paths, allowing you to specify each and every `tsconfig.json` in your monorepo. For those of you with too many packages, you can also supply a [glob path](https://github.com/isaacs/node-glob/blob/f5a57d3d6e19b324522a3fa5bdd5075fd1aa79d1/README.md#glob-primer). - -For example, this is how we specify all of our `tsconfig.json` within this repo. - -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - tsconfigRootDir: __dirname, - // Remove this line - project: ['./tsconfig.json'], - // Add this line - project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], - }, - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - ], -}; -``` - -If you're looking for an example of what the `.eslintrc.js`, and referenced `tsconfig.json` might look like in a real example, look no further than this very repo. We're a multi-package monorepo that uses one `tsconfig.json` per package, that also uses typed linting. - -### Important note regarding large (> 10) multi-package monorepos - -We've had reports that for sufficiently large and/or interdependent projects, you may run into OOMs using this approach. Our advice is to set it up and test first, as there are very few cases that trigger this OOM. We are in the process of investigating solutions with the help of the TypeScript team. - -See [#1192](https://github.com/typescript-eslint/typescript-eslint/issues/1192) for more information and discussion. - -If you do run into an OOM, please comment on the above issue and let us know about your repo - the more information we have, the better. As an interim workaround, consider one of the following: - -- Switching to one root `tsconfig.eslint.json` (see below) -- Using a shell script to only lint one package at a time, using your existing config above. - -## One root `tsconfig.json` - -If you've only got one, you should inspect the `include` paths. If it doesn't include all of your files, then we won't be able to lint them. In this instance, you have two options: add them in to the `include`, or create a new config. - -The former doesn't always work for everyone if they've got a complex build, as adding more paths (like test paths) to `include` could break the build. -In those cases we suggest creating a new config called `tsconfig.eslint.json`, that looks something like this: - -```jsonc title="tsconfig.eslint.json" -{ - // extend your base config to share compilerOptions, etc - "extends": "./tsconfig.json", - "compilerOptions": { - // ensure that nobody can accidentally use this config for a build - "noEmit": true - }, - "include": [ - // whatever paths you intend to lint - "src", - "test", - "tools" - ] -} -``` - -Ensure you update your `.eslintrc.js` to point at this new config file. - -## Troubleshooting - -If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](./TROUBLESHOOTING.md). diff --git a/docs/linting/README.md b/docs/linting/README.md deleted file mode 100644 index 23f0a2b1981..00000000000 --- a/docs/linting/README.md +++ /dev/null @@ -1,223 +0,0 @@ ---- -id: linting -title: Linting your TypeScript Codebase -sidebar_label: Linting your TypeScript Codebase ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -Whether you're adding linting to a new TypeScript codebase, adding TypeScript to an old codebase, or migrating from the deprecated [TSLint](https://www.npmjs.com/package/tslint), the steps aren't a whole lot different. - -## Installation - -First step is to make sure you've got the required packages installed: - -```bash npm2yarn -npm install --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin -``` - -## Configuration - -Next, create a `.eslintrc.cjs` config file in the root of your project, and populate it with the following: - - -```js title=".eslintrc.cjs" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: [ - '@typescript-eslint', - ], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - ], -}; -``` - -This is about the smallest config file we recommend. There's a lot more you can add to this as you further onboard, but this will be enough to get you started. - -:::info - -The `.cjs` extension will explicitly set the file to a [CommonJS module](https://nodejs.org/dist/latest-v18.x/docs/api/modules.html), in case your project has `"type": "module"` in its package.json. - -If your project doesn't use ESM, naming the file as `.eslintrc.js` is fine. See [ESLint's Configuration Files docs](https://eslint.org/docs/user-guide/configuring/configuration-files) for more info. - -::: - -### Details - -Explaining the important bits: - -- `parser: '@typescript-eslint/parser'` tells ESLint to use the parser package you installed ([`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser)). - - This allows ESLint to understand TypeScript syntax. - - This is required, or else ESLint will throw errors as it tries to parse TypeScript code as if it were regular JavaScript. -- `plugins: ['@typescript-eslint']` tells ESLint to load the plugin package you installed ([`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin)). - - This allows you to use the rules within your codebase. -- `extends: [ ... ]` tells ESLint that your config extends the given configurations. - - `eslint:recommended` is ESLint's inbuilt "recommended" config - it turns on a small, sensible set of rules which lint for well-known best-practices. - - `plugin:@typescript-eslint/recommended` is our "recommended" config - it's just like `eslint:recommended`, except it only turns on rules from our TypeScript-specific plugin. - -### Ignoring unnecessary files - -Next, create a `.eslintignore` file in the root of your project. -This file will tell ESLint which files and folders it should never lint. - -Add the following lines to the file: - -```ignore title=".eslintignore" -# don't lint build output (make sure it's set to your correct build folder name) -dist -``` - -### Further Configuration Documentation - -- You can read more about configuring ESLint [in their documentation on configuration](https://eslint.org/docs/user-guide/configuring). -- You can read more about the rules provided by ESLint [in their documentation on their rules](https://eslint.org/docs/rules/). -- You can read more about the rules provided by us in [our plugin documentation](https://typescript-eslint.io/rules/). - -## Running ESLint - -With that configured, open a terminal to the root of your project, and run the following command: - - - - -```bash -npx eslint . -``` - - - - -```bash -yarn eslint . -``` - - - - -That's it - ESLint will lint all TypeScript compatible files within the current folder, and will output the results to your terminal. - -You are also recommended to add an npm script in your package.json, so you don't have to repeat the same command every time you run ESLint. - -```json title="package.json" -{ - "scripts": { - "lint": "eslint ." - } -} -``` - -This way, you can invoke the `lint` script directly: - -```bash npm2yarn -npm run lint -``` - -:::note -If you use non-standard file extensions, you will need to explicitly tell ESLint to lint those extensions using the [`--ext` flag](https://eslint.org/docs/user-guide/command-line-interface#--ext) -::: - -You can also get results in realtime inside most IDEs via a plugin - search your IDE's extension store. - -## Next Steps - -With that configured you can now start to delve into the wide and extensive ESLint ecosystem of plugins and configs. - -### Type-Aware Rules - -We have a lot of awesome rules which utilize the power of TypeScript's type information. They require a little bit of extra setup beyond this first step, [so visit the next page to see how to set this up.](./TYPED_LINTING.md) - -### Prettier - -If you use [`prettier`](https://www.npmjs.com/package/prettier), there is also a helpful config to help ensure ESLint doesn't report on formatting issues that prettier will fix: [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier). - -Using this config by adding it to the end of your `extends`: - -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - // Add this line - 'prettier', - ], -}; -``` - -### Community Configs - -Configurations exist solely to provide a comprehensive base config for you, with the intention that you add the config and it gives you an opinionated setup. -Many configuration packages exist in the ESLint ecosystem. -A few popular all-in-one configs are: - -- Airbnb's ESLint config: [`eslint-config-airbnb-typescript`](https://www.npmjs.com/package/eslint-config-airbnb-typescript). -- Standard: [`eslint-config-standard-with-typescript`](https://www.npmjs.com/package/eslint-config-standard-with-typescript). - -To use one of these complete config packages, you would replace the `extends` with the package name. -For example: - -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - extends: [ - // Removed lines start - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - // Removed lines end - // Add this line - 'airbnb-typescript', - ], -}; -``` - - - -Search ["eslint-config" on npm](https://www.npmjs.com/search?q=eslint-config) for more. - -### Plugins - -ESLint plugins provide additional rules and other functionality on top of ESLint. -Below are just a few examples: - -- ESLint comment restrictions: [`eslint-plugin-eslint-comments`](https://www.npmjs.com/package/eslint-plugin-eslint-comments) -- Import/export conventions : [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import) -- Jest testing: [`eslint-plugin-jest`](https://www.npmjs.com/package/eslint-plugin-jest) -- NodeJS best practices: [`eslint-plugin-node`](https://www.npmjs.com/package/eslint-plugin-node) -- React best practices: [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react) and [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) - -Every plugin that is out there includes documentation on the various configurations and rules they offer. -A typical plugin might be used like: - -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: [ - '@typescript-eslint', - // Add this line - 'jest', - ], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - // Add this line - 'plugin:jest/recommended', - ], -}; -``` - - - -Search ["eslint-plugin" on npm](https://www.npmjs.com/search?q=eslint-plugin) for more. - -## Troubleshooting - -If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](./TROUBLESHOOTING.md). diff --git a/docs/linting/TROUBLESHOOTING.md b/docs/linting/TROUBLESHOOTING.md index d9c447b4d0e..f37f8780a33 100644 --- a/docs/linting/TROUBLESHOOTING.md +++ b/docs/linting/TROUBLESHOOTING.md @@ -1,7 +1,6 @@ --- id: troubleshooting title: Troubleshooting & FAQs -sidebar_label: Troubleshooting & FAQs --- ## I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code @@ -31,12 +30,10 @@ If you don't find an existing extension rule, or the extension rule doesn't work ## I get errors telling me "The file must be included in at least one of the projects provided" -This error means that the file that's being linted is not included in any of the tsconfig files you provided us. +This error means that the file that's being linted is not included in any of the TSConfig files you provided us. This happens when users have test files, config files, or similar that are not included. -There are a couple of solutions to this, depending on what you want to achieve. - -See our docs on [type aware linting](./TYPED_LINTING.md#i-get-errors-telling-me-the-file-must-be-included-in-at-least-one-of-the-projects-provided) for solutions to this. +See our docs on [type aware linting](./TYPED_LINTING.md#i-get-errors-telling-me-the-file-must-be-included-in-at-least-one-of-the-projects-provided) for solutions. ## I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config" diff --git a/docs/linting/TYPED_LINTING.md b/docs/linting/TYPED_LINTING.md index ae58028e442..7a037e9a178 100644 --- a/docs/linting/TYPED_LINTING.md +++ b/docs/linting/TYPED_LINTING.md @@ -1,11 +1,9 @@ --- -id: type-linting +id: typed-linting title: Linting with Type Information -sidebar_label: Linting with Type Information --- -Under the hood, the typescript-eslint parser uses TypeScript's compiler APIs to parse the files. This means that we can provide lint rules with access to all of the type information that TypeScript knows about your codebase. - +Some typescript-eslint rules tap utilize the awesome power of TypeScript's type checking APIs to provide much deeper insights into your code. To tap into TypeScript's additional powers, there are two small changes you need to make to your config file: ```js title=".eslintrc.js" @@ -32,22 +30,23 @@ In more detail: - `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory. - `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is. - - If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./MONOREPO.md). + - If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/MONOREPOS.md). - `plugin:@typescript-eslint/recommended-requiring-type-checking` is another recommended configuration we provide. This one contains rules that specifically require type information. With that done, run the same lint command you ran before. -You will see new rules reporting errors based on type information! +You may see new rules reporting errors based on type information! ## FAQs ### How is performance? -_But wait_ - I hear you exclaim - _why would you ever not want type-aware rules?_ - -Well (for full disclosure) there is a catch; by including `parserOptions.project` in your config, you are essentially asking TypeScript to do a build of your project before ESLint can do its linting. For small projects this takes a negligible amount of time (a few seconds); for large projects, it can take longer (30s or more). +Typed rules come with a catch. +By including `parserOptions.project` in your config, you incur the performance penalty of asking TypeScript to do a build of your project before ESLint can do its linting. +For small projects this takes a negligible amount of time (a few seconds or less); for large projects, it can take longer. -Most of our users are fine with this, as they think the power of type-aware static analysis is worth it. -Additionally, most users primarily consume lint errors via IDE plugins which, through some caching magic, do not suffer the same penalties. This means that generally they usually only run a complete lint before a push, or via their CI, where the extra time really doesn't matter. +Most of our users do not mind this cost as the power and safety of type-aware static analysis rules is worth the tradeoff. +Additionally, most users primarily consume lint errors via IDE plugins which, through caching, do not suffer the same penalties. +This means that generally they usually only run a complete lint before a push, or via their CI, where the extra time often doesn't matter. **We strongly recommend you do use type-aware linting**, but the above information is included so that you can make your own, informed decision. diff --git a/docs/linting/TSLINT.md b/docs/linting/troubleshooting/TSLINT.md similarity index 63% rename from docs/linting/TSLINT.md rename to docs/linting/troubleshooting/TSLINT.md index 0d7954dd350..a145f9fca61 100644 --- a/docs/linting/TSLINT.md +++ b/docs/linting/troubleshooting/TSLINT.md @@ -10,9 +10,10 @@ TSLint was a linter equivalent to ESLint that was written specifically to work d ## Migrating from TSLint to ESLint -If you are looking for help in migrating from TSLint to ESLint, see [`tslint-to-eslint-config`](https://github.com/typescript-eslint/tslint-to-eslint-config). +The standard tool to convert a TSLint configuration to the equivalent ESLint configuration is [`tslint-to-eslint-config`](https://github.com/typescript-eslint/tslint-to-eslint-config). +If you are still using TSLint, we strongly recommend you use this tool to switch. -You can look at [`the plugin ROADMAP.md`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/ROADMAP.md) for an up to date overview of how TSLint rules compare to the ones in this package. +You can look at [the alternatives list](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/TSLINT_RULE_ALTERNATIVES.md) for an up to date overview of how TSLint rules compare to the ones in this package. There is also the ultimate fallback option of using both linters together for a while during your transition if you absolutely have to by using TSLint _within_ ESLint. @@ -27,6 +28,5 @@ TSLint had to reimplement everything from editor extensions to auto-fixing to ru TSLint's backers announced in 2019 that **they would be deprecating TSLint in favor of supporting `typescript-eslint`** in order to benefit the community. You can read more about that here: https://medium.com/palantir/tslint-in-2019-1a144c2317a9. -The TypeScript Team themselves also announced their plans to move the TypeScript codebase from TSLint to `typescript-eslint`, -and they have been big supporters of this project. -More details at https://github.com/microsoft/TypeScript/issues/30553. +The TypeScript team also migrated move the TypeScript codebase from TSLint to `typescript-eslint`, and they have been supporters of this project. +See more details at https://github.com/microsoft/TypeScript/issues/30553. diff --git a/docs/linting/typed-linting/MONOREPOS.md b/docs/linting/typed-linting/MONOREPOS.md new file mode 100644 index 00000000000..a67d05a9c2c --- /dev/null +++ b/docs/linting/typed-linting/MONOREPOS.md @@ -0,0 +1,79 @@ +--- +id: monorepos +title: Monorepo Configuration +--- + +If you're using a monorepo, these docs will help you figure out how to setup typed linting. +If you don't want to use typed linting, then you can stop here - you don't need to do anything special. + +Configurations will look different based on which setup you use: + +1. [One root `tsconfig.json`](#one-root-tsconfigjson) +2. [One `tsconfig.json` per package (and an optional one in the root)](#one-tsconfigjson-per-package-and-an-optional-one-in-the-root) + +## One root `tsconfig.json` + +If you only have one `tsconfig.json` file _and_ its `include` paths include all the files you'd like to lint, you can directly use it with typescript-eslint without further configuration. + +If its `include` paths cannot include all files to be linted, we suggest creating a new config called `tsconfig.eslint.json`, that looks something like this: + +```jsonc title="tsconfig.eslint.json" +{ + // extend your base config to share compilerOptions, etc + "extends": "./tsconfig.json", + "compilerOptions": { + // ensure that nobody can accidentally use this config for a build + "noEmit": true + }, + "include": [ + // whatever paths you intend to lint + "src", + "test", + "tools" + ] +} +``` + +Be sure to update your `.eslintrc.js` to point at this new config file. + +## One `tsconfig.json` per package (and an optional one in the root) + +The `parserOptions.project` option introduced in [Linting with Type Information](../TYPED_LINTING.md) accepts an array of relative paths. +Paths may be provided as [Node globs](https://github.com/isaacs/node-glob/blob/f5a57d3d6e19b324522a3fa5bdd5075fd1aa79d1/README.md#glob-primer). + +```js title=".eslintrc.js" +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: __dirname, + // Remove this line + project: ['./tsconfig.json'], + // Add this line + project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], + }, + plugins: ['@typescript-eslint'], + root: true, +}; +``` + +### Important note regarding large (> 10) multi-package monorepos + +We've had reports that for sufficiently large and/or interdependent projects, you may run into OOMs using this approach. +Our advice is to set it up and test first, as there are very few cases that trigger this OOM. + +See [#1192](https://github.com/typescript-eslint/typescript-eslint/issues/1192) for more information and discussion. + +If you do run into an OOM, please comment on the above issue and let us know about your repo - the more information we have, the better. +As an interim workaround, consider one of the following: + +- Switching to one root `tsconfig.eslint.json` (see below) +- Using a shell script to only lint one package at a time, using your existing config above. + +## Troubleshooting + +If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](../TROUBLESHOOTING.md). diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 5124ce841ae..f236aeacd81 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -85,7 +85,7 @@ Some highly valuable rules require type-checking in order to be implemented corr Pro Tip: For larger codebases you may want to consider splitting our linting into two separate stages: 1. fast feedback rules which operate purely based on syntax (no type-checking), 2. rules which are based on semantics (type-checking). -**[You can read more about linting with type information here](https://typescript-eslint.io/docs/linting/type-linting)** +**[You can read more about linting with type information here](https://typescript-eslint.io/docs/linting/typed-linting)** ## Supported Rules diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 6ebff3867c6..e108f6140b7 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -1,726 +1,3 @@ -# TSLint Migration Guide +# This page moved to [TSLINT_RULE_ALTERNATIVES.md](./TSLINT_RULE_ALTERNATIVES.md) -This document serves as a guide to help you migrate from TSLint. -It lists all TSLint rules along side rules from the ESLint ecosystem that are the same or similar. - -## TSLint rules - -βœ… = done
-🌟 = in ESLint core
-πŸ”Œ = in another plugin
-πŸŒ“ = implementations differ or ESLint version is missing functionality
-πŸ›‘ = unimplemented
- -### TypeScript-specific - -| TSLint rule | | ESLint rule | -| --------------------------------- | :-: | ---------------------------------------------------- | -| [`adjacent-overload-signatures`] | βœ… | [`@typescript-eslint/adjacent-overload-signatures`] | -| [`ban-ts-ignore`] | βœ… | [`@typescript-eslint/ban-ts-comment`] | -| [`ban-types`] | πŸŒ“ | [`@typescript-eslint/ban-types`][1] | -| [`invalid-void`] | βœ… | [`@typescript-eslint/no-invalid-void-type`] | -| [`member-access`] | βœ… | [`@typescript-eslint/explicit-member-accessibility`] | -| [`member-ordering`] | βœ… | [`@typescript-eslint/member-ordering`] | -| [`no-any`] | βœ… | [`@typescript-eslint/no-explicit-any`] | -| [`no-empty-interface`] | βœ… | [`@typescript-eslint/no-empty-interface`] | -| [`no-import-side-effect`] | πŸ”Œ | [`import/no-unassigned-import`] | -| [`no-inferrable-types`] | βœ… | [`@typescript-eslint/no-inferrable-types`] | -| [`no-internal-module`] | βœ… | [`@typescript-eslint/prefer-namespace-keyword`] | -| [`no-magic-numbers`] | βœ… | [`@typescript-eslint/no-magic-numbers`] | -| [`no-namespace`] | βœ… | [`@typescript-eslint/no-namespace`] | -| [`no-non-null-assertion`] | βœ… | [`@typescript-eslint/no-non-null-assertion`] | -| [`no-parameter-reassignment`] | βœ… | [`no-param-reassign`][no-param-reassign] | -| [`no-reference`] | βœ… | [`@typescript-eslint/triple-slash-reference`] | -| [`no-unnecessary-type-assertion`] | βœ… | [`@typescript-eslint/no-unnecessary-type-assertion`] | -| [`no-var-requires`] | βœ… | [`@typescript-eslint/no-var-requires`] | -| [`only-arrow-functions`] | πŸ”Œ | [`prefer-arrow/prefer-arrow-functions`] | -| [`prefer-for-of`] | βœ… | [`@typescript-eslint/prefer-for-of`] | -| [`promise-function-async`] | βœ… | [`@typescript-eslint/promise-function-async`] | -| [`typedef-whitespace`] | βœ… | [`@typescript-eslint/type-annotation-spacing`] | -| [`typedef`] | βœ… | [`@typescript-eslint/typedef`] | -| [`unified-signatures`] | βœ… | [`@typescript-eslint/unified-signatures`] | - -[1] The ESLint rule only supports exact string matching, rather than regular expressions
- -### Functionality - -| TSLint rule | | ESLint rule | -| ------------------------------------ | :-: | --------------------------------------------------------------------------------------------------------- | -| [`await-promise`] | βœ… | [`@typescript-eslint/await-thenable`] | -| [`ban-comma-operator`] | 🌟 | [`no-sequences`][no-sequences] | -| [`ban`] | 🌟 | [`no-restricted-globals`][no-restricted-globals] & [`no-restricted-properties`][no-restricted-properties] | -| [`curly`] | 🌟 | [`curly`][curly] | -| [`forin`] | 🌟 | [`guard-for-in`][guard-for-in] | -| [`function-constructor`] | 🌟 | [`no-new-func`][no-new-func] | -| [`import-blacklist`] | 🌟 | [`no-restricted-imports`][no-restricted-imports] | -| [`label-position`] | 🌟 | [`no-unused-labels`][no-unused-labels] (similar) | -| [`no-arg`] | 🌟 | [`no-caller`][no-caller] (also blocks `arguments.caller`) | -| [`no-async-without-await`] | βœ… | [`@typescript-eslint/require-await`] | -| [`no-bitwise`] | 🌟 | [`no-bitwise`][no-bitwise] | -| [`no-conditional-assignment`] | 🌟 | [`no-cond-assign`][no-cond-assign][1] | -| [`no-console`] | 🌟 | [`no-console`][no-console] (configuration works slightly differently) | -| [`no-construct`] | 🌟 | [`no-new-wrappers`][no-new-wrappers] | -| [`no-debugger`] | 🌟 | [`no-debugger`][no-debugger] | -| [`no-duplicate-super`] | 🌟 | [`constructor-super`][constructor-super] | -| [`no-duplicate-switch-case`] | 🌟 | [`no-duplicate-case`][no-duplicate-case] | -| [`no-duplicate-variable`] | 🌟 | [`no-redeclare`][no-redeclare] | -| [`no-dynamic-delete`] | βœ… | [`@typescript-eslint/no-dynamic-delete`] | -| [`no-empty`] | 🌟 | [`no-empty`][no-empty] | -| [`no-eval`] | 🌟 | [`no-eval`][no-eval] | -| [`no-floating-promises`] | βœ… | [`@typescript-eslint/no-floating-promises`] | -| [`no-for-in-array`] | βœ… | [`@typescript-eslint/no-for-in-array`] | -| [`no-implicit-dependencies`] | πŸ”Œ | [`import/no-extraneous-dependencies`] | -| [`no-inferred-empty-object-type`] | πŸ›‘ | N/A | -| [`no-invalid-template-strings`] | 🌟 | [`no-template-curly-in-string`][no-template-curly-in-string] | -| [`no-invalid-this`] | 🌟 | [`no-invalid-this`][no-invalid-this] | -| [`no-misused-new`] | βœ… | [`@typescript-eslint/no-misused-new`] | -| [`no-null-keyword`] | πŸ”Œ | [`no-null/no-null`] (doesn’t handle `null` type) | -| [`no-null-undefined-union`] | πŸ›‘ | N/A | -| [`no-object-literal-type-assertion`] | βœ… | [`@typescript-eslint/consistent-type-assertions`] | -| [`no-promise-as-boolean`] | βœ… | [`@typescript-eslint/no-misused-promises`] | -| [`no-restricted-globals`] | βœ… | [`no-restricted-globals`][no-restricted-globals] | -| [`no-return-await`] | 🌟 | [`no-return-await`][no-return-await] | -| [`no-shadowed-variable`] | 🌟 | [`no-shadow`][no-shadow] | -| [`no-sparse-arrays`] | 🌟 | [`no-sparse-arrays`][no-sparse-arrays] | -| [`no-string-literal`] | 🌟 | [`dot-notation`][dot-notation] | -| [`no-string-throw`] | βœ… | [`@typescript-eslint/no-throw-literal`] | -| [`no-submodule-imports`] | πŸŒ“ | [`import/no-internal-modules`] (slightly different) | -| [`no-switch-case-fall-through`] | 🌟 | [`no-fallthrough`][no-fallthrough] | -| [`no-tautology-expression`] | πŸ›‘ | N/A | -| [`no-this-assignment`] | βœ… | [`@typescript-eslint/no-this-alias`] | -| [`no-unbound-method`] | βœ… | [`@typescript-eslint/unbound-method`] | -| [`no-unnecessary-class`] | βœ… | [`@typescript-eslint/no-extraneous-class`] | -| [`no-unsafe-any`] | πŸŒ“ | [`@typescript-eslint/no-unsafe-member-access`][2] | -| [`no-unsafe-finally`] | 🌟 | [`no-unsafe-finally`][no-unsafe-finally] | -| [`no-unused-expression`] | 🌟 | [`no-unused-expressions`][no-unused-expressions] | -| [`no-unused-variable`] | πŸŒ“ | [`@typescript-eslint/no-unused-vars`] | -| [`no-use-before-declare`] | βœ… | [`@typescript-eslint/no-use-before-define`] | -| [`no-var-keyword`] | 🌟 | [`no-var`][no-var] | -| [`no-void-expression`] | βœ… | [`@typescript-eslint/no-confusing-void-expression`] | -| [`prefer-conditional-expression`] | πŸ›‘ | N/A | -| [`prefer-object-spread`] | 🌟 | [`prefer-object-spread`][prefer-object-spread] | -| [`radix`] | 🌟 | [`radix`][radix] | -| [`restrict-plus-operands`] | βœ… | [`@typescript-eslint/restrict-plus-operands`] | -| [`static-this`] | πŸ›‘ | N/A | -| [`strict-boolean-expressions`] | βœ… | [`@typescript-eslint/strict-boolean-expressions`] | -| [`strict-string-expressions`] | βœ… | [`@typescript-eslint/restrict-plus-operands`] & [`@typescript-eslint/restrict-template-expressions`] | -| [`strict-type-predicates`] | πŸ›‘ | N/A | -| [`switch-default`] | 🌟 | [`default-case`][default-case] | -| [`triple-equals`] | 🌟 | [`eqeqeq`][eqeqeq] | -| [`typeof-compare`] | 🌟 | [`valid-typeof`][valid-typeof] | -| [`unnecessary-constructor`] | 🌟 | [`no-useless-constructor`][no-useless-constructor] | -| [`use-default-type-parameter`] | βœ… | [`@typescript-eslint/no-unnecessary-type-arguments`] | -| [`use-isnan`] | 🌟 | [`use-isnan`][use-isnan] | - -[1] The ESLint rule also supports silencing with an extra set of parentheses (`if ((foo = bar)) {}`)
-[2] Only checks member expressions - -### Maintainability - -| TSLint rule | | ESLint rule | -| ---------------------------- | :-: | -------------------------------------------------- | -| [`cyclomatic-complexity`] | 🌟 | [`complexity`][complexity] | -| [`deprecation`] | πŸ”Œ | [`deprecation/deprecation`] | -| [`eofline`] | 🌟 | [`eol-last`][eol-last] | -| [`indent`] | βœ… | [`@typescript-eslint/indent`] or [Prettier] | -| [`linebreak-style`] | 🌟 | [`linebreak-style`][linebreak-style] or [Prettier] | -| [`max-classes-per-file`] | 🌟 | [`max-classes-per-file`][max-classes-per-file] | -| [`max-file-line-count`] | 🌟 | [`max-lines`][max-lines] | -| [`max-line-length`] | 🌟 | [`max-len`][max-len] or [Prettier] | -| [`no-default-export`] | πŸ”Œ | [`import/no-default-export`] | -| [`no-default-import`] | πŸ›‘ | N/A | -| [`no-duplicate-imports`] | πŸ”Œ | [`import/no-duplicates`] | -| [`no-mergeable-namespace`] | πŸ›‘ | N/A | -| [`no-require-imports`] | βœ… | [`@typescript-eslint/no-require-imports`] | -| [`object-literal-sort-keys`] | πŸŒ“ | [`sort-keys`][sort-keys] [2] | -| [`prefer-const`] | 🌟 | [`prefer-const`][prefer-const] | -| [`prefer-readonly`] | βœ… | [`@typescript-eslint/prefer-readonly`] | -| [`trailing-comma`] | πŸŒ“ | [`comma-dangle`][comma-dangle] or [Prettier] | - -[2] Missing support for blank-line-delimited sections - -### Style - -| TSLint rule | | ESLint rule | -| ----------------------------------- | :-: | ----------------------------------------------------------------------------------- | -| [`align`] | πŸ›‘ | N/A | -| [`array-type`] | βœ… | [`@typescript-eslint/array-type`] | -| [`arrow-parens`] | 🌟 | [`arrow-parens`][arrow-parens] | -| [`arrow-return-shorthand`] | 🌟 | [`arrow-body-style`][arrow-body-style] | -| [`binary-expression-operand-order`] | 🌟 | [`yoda`][yoda] | -| [`callable-types`] | βœ… | [`@typescript-eslint/prefer-function-type`] | -| [`class-name`] | βœ… | [`@typescript-eslint/naming-convention`] | -| [`comment-format`] | 🌟 | [`capitalized-comments`][capitalized-comments] & [`spaced-comment`][spaced-comment] | -| [`comment-type`] | πŸ›‘ | N/A | -| [`completed-docs`] | πŸ”Œ | [`jsdoc/require-jsdoc`] | -| [`encoding`] | πŸ›‘ | N/A | -| [`file-header`] | πŸ”Œ | [`eslint-plugin-header`][plugin:header] or [`-file-header`][plugin:file-header] | -| [`file-name-casing`] | πŸ”Œ | [`unicorn/filename-case`] | -| [`import-spacing`] | πŸ”Œ | Use [Prettier] | -| [`increment-decrement`] | 🌟 | [`no-plusplus`][no-plusplus] | -| [`interface-name`] | βœ… | [`@typescript-eslint/interface-name-prefix`] | -| [`interface-over-type-literal`] | βœ… | [`@typescript-eslint/consistent-type-definitions`] | -| [`jsdoc-format`] | πŸŒ“ | [`valid-jsdoc`][valid-jsdoc] or [`eslint-plugin-jsdoc`][plugin:jsdoc] | -| [`match-default-export-name`] | πŸ›‘ | N/A | -| [`newline-before-return`] | 🌟 | [`padding-line-between-statements`][padding-line-between-statements] [1] | -| [`newline-per-chained-call`] | 🌟 | [`newline-per-chained-call`][newline-per-chained-call] | -| [`new-parens`] | 🌟 | [`new-parens`][new-parens] | -| [`no-angle-bracket-type-assertion`] | βœ… | [`@typescript-eslint/consistent-type-assertions`] | -| [`no-boolean-literal-compare`] | βœ… | [`@typescript-eslint/no-unnecessary-boolean-literal-compare`] | -| [`no-consecutive-blank-lines`] | 🌟 | [`no-multiple-empty-lines`][no-multiple-empty-lines] | -| [`no-irregular-whitespace`] | 🌟 | [`no-irregular-whitespace`][no-irregular-whitespace] with `skipStrings: false` | -| [`no-parameter-properties`] | βœ… | [`@typescript-eslint/parameter-properties`] | -| [`no-redundant-jsdoc`] | πŸ”Œ | [`jsdoc/no-types`] | -| [`no-reference-import`] | βœ… | [`@typescript-eslint/triple-slash-reference`] | -| [`no-trailing-whitespace`] | 🌟 | [`no-trailing-spaces`][no-trailing-spaces] | -| [`no-unnecessary-callback-wrapper`] | πŸ›‘ | N/A and this might be unsafe (i.e. with `forEach`) | -| [`no-unnecessary-else`] | 🌟 | [`no-else-return`][no-else-return] [2] | -| [`no-unnecessary-initializer`] | 🌟 | [`no-undef-init`][no-undef-init] | -| [`no-unnecessary-qualifier`] | βœ… | [`@typescript-eslint/no-unnecessary-qualifier`] | -| [`number-literal-format`] | πŸ›‘ | N/A | -| [`object-literal-key-quotes`] | 🌟 | [`quote-props`][quote-props] | -| [`object-literal-shorthand`] | 🌟 | [`object-shorthand`][object-shorthand] | -| [`one-line`] | 🌟 | [`brace-style`][brace-style] or [Prettier] | -| [`one-variable-per-declaration`] | 🌟 | [`one-var`][one-var] | -| [`ordered-imports`] | πŸŒ“ | [`import/order`] | -| [`prefer-function-over-method`] | 🌟 | [`class-methods-use-this`][class-methods-use-this] | -| [`prefer-method-signature`] | βœ… | [`@typescript-eslint/method-signature-style`] | -| [`prefer-switch`] | πŸ›‘ | N/A | -| [`prefer-template`] | 🌟 | [`prefer-template`][prefer-template] | -| [`prefer-while`] | πŸ›‘ | N/A | -| [`quotemark`] | 🌟 | [`quotes`][quotes] | -| [`return-undefined`] | πŸ›‘ | N/A | -| [`semicolon`] | πŸŒ“ | [`@typescript-eslint/semi`] | -| [`space-before-function-paren`] | 🌟 | [`space-before-function-paren`][space-after-function-paren] | -| [`space-within-parens`] | 🌟 | [`space-in-parens`][space-in-parens] | -| [`switch-final-break`] | πŸ›‘ | N/A | -| [`type-literal-delimiter`] | βœ… | [`@typescript-eslint/member-delimiter-style`] | -| [`unnecessary-bind`] | 🌟 | [`no-extra-bind`][no-extra-bind] | -| [`variable-name`] | βœ… | [`@typescript-eslint/naming-convention`] | -| [`whitespace`] | πŸ”Œ | Use [Prettier] | - -[1] Recommended config: `["error", { blankLine: "always", prev: "*", next: "return" }]`
-[2] Doesn't check other control flow statements, such as `break` or `continue`. - -## `tslint-microsoft-contrib` rules - -Rule listing is [here](https://github.com/Microsoft/tslint-microsoft-contrib#supported-rules). -Deprecated rules are excluded (`missing-jsdoc`, `missing-optional-annotation`, `no-duplicate-case`, `no-duplicate-parameter-names`, `no-function-constructor-with-string-args`, `no-increment-decrement`, `no-empty-interfaces`, `no-missing-visibility-modifiers`, `no-multiple-var-decl`, `no-reserved-keywords`, `no-stateless-class`, `no-var-self`, `no-unnecessary-bind`, and `valid-typeof`). See the docs in the link above to find out what to use instead. - -### Testing - -Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint-plugin-chai-expect-keywords), [`chai-expect`](https://github.com/Turbo87/eslint-plugin-chai-expect), [`chai-friendly`](https://github.com/ihordiachenko/eslint-plugin-chai-friendly), [`mocha`](https://github.com/lo1tuma/eslint-plugin-mocha), and [`jest`](https://github.com/jest-community/eslint-plugin-jest) - -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ---------------------------------- | :-: | ------------------------- | -| `chai-prefer-contains-to-index-of` | πŸ›‘ | N/A | -| `chai-vague-errors` | πŸ›‘ | N/A | -| `mocha-avoid-only` | πŸ”Œ | [`jest/no-focused-tests`] | -| `mocha-unneeded-done` | πŸ›‘ | N/A | - -### TypeScript - -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ------------------------------- | :-: | ---------------------------------------------------------- | -| `prefer-array-literal` | πŸŒ“ | [`@typescript-eslint/no-array-constructor`] [1] | -| `prefer-type-cast` | πŸ›‘ | N/A | - -[1] ESLint rule is slightly less strict, allowing `new Array()` and `Array(2)`. - -### Miscellaneous - -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ------------------------------------- | :-: | ---------------------------------------------------------------------- | -| `export-name` | πŸ›‘ | N/A ([relevant plugin][plugin:import]) | -| `function-name` | πŸ›‘ | N/A | -| `import-name` | πŸ›‘ | N/A ([relevant plugin][plugin:import]) | -| `informative-docs` | πŸ›‘ | N/A | -| `max-func-body-length` | 🌟 | [`max-statements`][max-statements] | -| `no-banned-terms` | 🌟 | [`no-caller`][no-caller] & [`no-eval`][no-eval] | -| `no-constant-condition` | 🌟 | [`no-constant-condition`][no-constant-condition] | -| `no-control-regex` | 🌟 | [`no-control-regex`][no-control-regex] | -| `no-delete-expression` | βœ… | [`@typescript-eslint/no-dynamic-delete`] | -| `no-empty-line-after-opening-brace` | 🌟 | [`padded-blocks`][padded-blocks] [1] or [Prettier] | -| `no-for-in` | 🌟 | [`no-restricted-syntax`][no-restricted-syntax] [2] | -| `no-function-expression` | 🌟 | [`func-style`][func-style] [3] | -| `no-invalid-regexp` | 🌟 | [`no-invalid-regexp`][no-invalid-regexp] | -| `no-multiline-string` | 🌟 | [`no-multi-str`][no-multi-str] | -| `no-octal-literal` | 🌟 | [`no-octal-escape`][no-octal-escape], see also [`no-octal`][no-octal] | -| `no-regex-spaces` | 🌟 | [`no-regex-spaces`][no-regex-spaces] | -| `no-relative-imports` | πŸ›‘ | N/A, _Not recommended by the maintainers_ | -| `no-single-line-block-comment` | πŸ›‘ | N/A | -| `no-suspicious-comment` | 🌟 | [`no-warning-comments`][no-warning-comments] [4] | -| `no-typeof-undefined` | πŸ›‘ | N/A (this actually has a valid use: checking if a variable is defined) | -| `no-unexternalized-strings` | πŸ›‘ | N/A | -| `no-unnecessary-field-initialization` | πŸŒ“ | [`no-undef-init`][no-undef-init] [5] | -| `no-unnecessary-local-variable` | πŸ›‘ | N/A | -| `no-unnecessary-override` | πŸ›‘ | N/A | -| `no-unnecessary-semicolons` | 🌟 | [`no-extra-semi`][no-extra-semi] or [Prettier] | -| `no-useless-files` | πŸ›‘ | N/A | -| `no-with-statement` | 🌟 | [`no-with`][no-with] | -| `promise-must-complete` | πŸ›‘ | N/A | -| `underscore-consistent-invocation` | πŸ”Œ | [`lodash/chaining`] | -| `use-named-parameter` | πŸ›‘ | N/A | -| `use-simple-attributes` | πŸ›‘ | N/A | - -[1] Enforces blank lines both at the beginning and end of a block
-[2] Recommended config: `["error", "ForInStatement"]`
-[3] Recommended config: `["error", "declaration", { "allowArrowFunctions": true }]`
-[4] Recommended config: `["error", { "terms": ["BUG", "HACK", "FIXME", "LATER", "LATER2", "TODO"], "location": "anywhere" }]`
-[5] Does not check class fields. - -### Security - -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ------------------------------- | :-: | ------------------------------------------------------------------------------------------- | -| `insecure-random` | πŸ”Œ | [`desktop/insecure-random`] or [`@microsoft/sdl/no-insecure-random`] | -| `no-disable-auto-sanitization` | πŸ”Œ | [`@microsoft/sdl/no-msapp-exec-unsafe`] and [`@microsoft/sdl/no-winjs-html-unsafe`] | -| `no-document-domain` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-document-domain`] | -| `no-http-string` | πŸ”Œ | [`@microsoft/sdl/no-insecure-url`] | -| `no-inner-html` | πŸ”Œ | [`@microsoft/sdl/no-inner-html`] and [`@microsoft/sdl/no-html-method`] | -| `no-string-based-set-immediate` | πŸŒ“ | [`@typescript-eslint/no-implied-eval`] | -| `no-string-based-set-interval` | πŸŒ“ | [`@typescript-eslint/no-implied-eval`] | -| `no-string-based-set-timeout` | πŸŒ“ | [`@typescript-eslint/no-implied-eval`] | -| `react-anchor-blank-noopener` | πŸ”Œ | [`react/jsx-no-target-blank`] | -| `react-iframe-missing-sandbox` | πŸ”Œ | [`@microsoft/sdl/react-iframe-missing-sandbox`] | -| `react-no-dangerous-html` | πŸ”Œ | [`react/no-danger`] | -| `non-literal-fs-path` | πŸ”Œ | [`security/detect-non-literal-fs-filename`] | -| `non-literal-require` | πŸ”Œ | [`security/detect-non-literal-require`] | -| `possible-timing-attack` | πŸ”Œ | [`security/detect-possible-timing-attacks`] | - -### Browser - -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ----------------------------------- | :-: | -------------------------------------------------------------------------------------------- | -| `jquery-deferred-must-complete` | πŸ›‘ | N/A | -| `no-backbone-get-set-outside-model` | πŸ›‘ | N/A | -| `no-cookies` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-cookies`] | -| `no-document-write` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-document-write`] | -| `no-exec-script` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@typescript-eslint/no-implied-eval`] | -| `no-jquery-raw-elements` | πŸ›‘ | N/A | -| `no-unsupported-browser-code` | πŸ›‘ | N/A | -| `react-this-binding-issue` | πŸ›‘ | N/A | -| `react-tsx-curly-spacing` | πŸ”Œ | [`react/jsx-curly-spacing`] | -| `react-unused-props-and-state` | πŸŒ“ | [`react/no-unused-state`] | - -### React A11y - -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ----------------------------------------- | :-: | ---------------------------------------------------------- | -| `react-a11y-accessible-headings` | πŸŒ“ | [`jsx-a11y/heading-has-content`] [1] | -| `react-a11y-anchors` | πŸ”Œ | [`jsx-a11y/anchor-is-valid`] | -| `react-a11y-aria-unsupported-elements` | πŸ”Œ | [`jsx-a11y/aria-unsupported-elements`] | -| `react-a11y-event-has-role` | πŸŒ“ | [`jsx-a11y/no-static-element-interactions`] [2] | -| `react-a11y-image-button-has-alt` | πŸ”Œ | [`jsx-a11y/alt-text`] | -| `react-a11y-img-has-alt` | πŸ”Œ | [`jsx-a11y/alt-text`] | -| `react-a11y-input-elements` | πŸ›‘ | N/A | -| `react-a11y-lang` | πŸ”Œ | [`jsx-a11y/lang`] | -| `react-a11y-meta` | πŸ›‘ | N/A | -| `react-a11y-no-onchange` | πŸ”Œ | [`jsx-a11y/no-onchange`] | -| `react-a11y-props` | πŸ”Œ | [`jsx-a11y/aria-props`] | -| `react-a11y-proptypes` | πŸ”Œ | [`jsx-a11y/aria-proptypes`] | -| `react-a11y-required` | πŸ›‘ | N/A | -| `react-a11y-role-has-required-aria-props` | πŸ”Œ | [`jsx-a11y/role-has-required-aria-props`] | -| `react-a11y-role-supports-aria-props` | πŸ”Œ | [`jsx-a11y/role-supports-aria-props`] | -| `react-a11y-role` | πŸ”Œ | [`jsx-a11y/aria-role`] | -| `react-a11y-tabindex-no-positive` | πŸ”Œ | [`jsx-a11y/tabindex-no-positive`] | -| `react-a11y-titles` | πŸ›‘ | N/A | - -[1] TSLint rule is more strict
-[2] ESLint rule only reports for click handlers - -[prettier]: https://prettier.io - - - -[`adjacent-overload-signatures`]: https://palantir.github.io/tslint/rules/adjacent-overload-signatures -[`ban-ts-ignore`]: https://palantir.github.io/tslint/rules/ban-ts-ignore/ -[`ban-types`]: https://palantir.github.io/tslint/rules/ban-types -[`invalid-void`]: https://palantir.github.io/tslint/rules/invalid-void -[`member-access`]: https://palantir.github.io/tslint/rules/member-access -[`member-ordering`]: https://palantir.github.io/tslint/rules/member-ordering -[`no-any`]: https://palantir.github.io/tslint/rules/no-any -[`no-empty-interface`]: https://palantir.github.io/tslint/rules/no-empty-interface -[`no-import-side-effect`]: https://palantir.github.io/tslint/rules/no-import-side-effect -[`no-inferrable-types`]: https://palantir.github.io/tslint/rules/no-inferrable-types -[`no-internal-module`]: https://palantir.github.io/tslint/rules/no-internal-module -[`no-magic-numbers`]: https://palantir.github.io/tslint/rules/no-magic-numbers -[`no-namespace`]: https://palantir.github.io/tslint/rules/no-namespace -[`no-non-null-assertion`]: https://palantir.github.io/tslint/rules/no-non-null-assertion -[`no-parameter-reassignment`]: https://palantir.github.io/tslint/rules/no-parameter-reassignment -[`no-reference`]: https://palantir.github.io/tslint/rules/no-reference -[`no-unnecessary-type-assertion`]: https://palantir.github.io/tslint/rules/no-unnecessary-type-assertion -[`no-var-requires`]: https://palantir.github.io/tslint/rules/no-var-requires -[`only-arrow-functions`]: https://palantir.github.io/tslint/rules/only-arrow-functions -[`prefer-for-of`]: https://palantir.github.io/tslint/rules/prefer-for-of -[`promise-function-async`]: https://palantir.github.io/tslint/rules/promise-function-async -[`typedef`]: https://palantir.github.io/tslint/rules/typedef -[`typedef-whitespace`]: https://palantir.github.io/tslint/rules/typedef-whitespace -[`unified-signatures`]: https://palantir.github.io/tslint/rules/unified-signatures -[`await-promise`]: https://palantir.github.io/tslint/rules/await-promise -[`ban-comma-operator`]: https://palantir.github.io/tslint/rules/ban-comma-operator -[`ban`]: https://palantir.github.io/tslint/rules/ban -[`curly`]: https://palantir.github.io/tslint/rules/curly -[`forin`]: https://palantir.github.io/tslint/rules/forin -[`function-constructor`]: https://palantir.github.io/tslint/rules/function-constructor -[`import-blacklist`]: https://palantir.github.io/tslint/rules/import-blacklist -[`label-position`]: https://palantir.github.io/tslint/rules/label-position -[`no-arg`]: https://palantir.github.io/tslint/rules/no-arg -[`no-async-without-await`]: https://palantir.github.io/tslint/rules/no-async-without-await -[`no-bitwise`]: https://palantir.github.io/tslint/rules/no-bitwise -[`no-conditional-assignment`]: https://palantir.github.io/tslint/rules/no-conditional-assignment -[`no-console`]: https://palantir.github.io/tslint/rules/no-console -[`no-construct`]: https://palantir.github.io/tslint/rules/no-construct -[`no-debugger`]: https://palantir.github.io/tslint/rules/no-debugger -[`no-duplicate-super`]: https://palantir.github.io/tslint/rules/no-duplicate-super -[`no-duplicate-switch-case`]: https://palantir.github.io/tslint/rules/no-duplicate-switch-case -[`no-duplicate-variable`]: https://palantir.github.io/tslint/rules/no-duplicate-variable -[`no-dynamic-delete`]: https://palantir.github.io/tslint/rules/no-dynamic-delete -[`no-empty`]: https://palantir.github.io/tslint/rules/no-empty -[`no-eval`]: https://palantir.github.io/tslint/rules/no-eval -[`no-floating-promises`]: https://palantir.github.io/tslint/rules/no-floating-promises -[`no-for-in-array`]: https://palantir.github.io/tslint/rules/no-for-in-array -[`no-implicit-dependencies`]: https://palantir.github.io/tslint/rules/no-implicit-dependencies -[`no-inferred-empty-object-type`]: https://palantir.github.io/tslint/rules/no-inferred-empty-object-type -[`no-invalid-template-strings`]: https://palantir.github.io/tslint/rules/no-invalid-template-strings -[`no-invalid-this`]: https://palantir.github.io/tslint/rules/no-invalid-this -[`no-misused-new`]: https://palantir.github.io/tslint/rules/no-misused-new -[`no-null-keyword`]: https://palantir.github.io/tslint/rules/no-null-keyword -[`no-null-undefined-union`]: https://palantir.github.io/tslint/rules/no-null-undefined-union -[`no-object-literal-type-assertion`]: https://palantir.github.io/tslint/rules/no-object-literal-type-assertion -[`no-promise-as-boolean`]: https://palantir.github.io/tslint/rules/no-promise-as-boolean -[`no-restricted-globals`]: https://palantir.github.io/tslint/rules/no-restricted-globals -[`no-return-await`]: https://palantir.github.io/tslint/rules/no-return-await -[`no-shadowed-variable`]: https://palantir.github.io/tslint/rules/no-shadowed-variable -[`no-sparse-arrays`]: https://palantir.github.io/tslint/rules/no-sparse-arrays -[`no-string-literal`]: https://palantir.github.io/tslint/rules/no-string-literal -[`no-string-throw`]: https://palantir.github.io/tslint/rules/no-string-throw -[`no-submodule-imports`]: https://palantir.github.io/tslint/rules/no-submodule-imports -[`no-switch-case-fall-through`]: https://palantir.github.io/tslint/rules/no-switch-case-fall-through -[`no-tautology-expression`]: https://palantir.github.io/tslint/rules/no-tautology-expression -[`no-this-assignment`]: https://palantir.github.io/tslint/rules/no-this-assignment -[`no-unbound-method`]: https://palantir.github.io/tslint/rules/no-unbound-method -[`no-unnecessary-class`]: https://palantir.github.io/tslint/rules/no-unnecessary-class -[`no-unsafe-any`]: https://palantir.github.io/tslint/rules/no-unsafe-any -[`no-unsafe-finally`]: https://palantir.github.io/tslint/rules/no-unsafe-finally -[`no-unused-expression`]: https://palantir.github.io/tslint/rules/no-unused-expression -[`no-unused-variable`]: https://palantir.github.io/tslint/rules/no-unused-variable -[`no-use-before-declare`]: https://palantir.github.io/tslint/rules/no-use-before-declare -[`no-var-keyword`]: https://palantir.github.io/tslint/rules/no-var-keyword -[`no-void-expression`]: https://palantir.github.io/tslint/rules/no-void-expression -[`prefer-conditional-expression`]: https://palantir.github.io/tslint/rules/prefer-conditional-expression -[`prefer-object-spread`]: https://palantir.github.io/tslint/rules/prefer-object-spread -[`radix`]: https://palantir.github.io/tslint/rules/radix -[`restrict-plus-operands`]: https://palantir.github.io/tslint/rules/restrict-plus-operands -[`static-this`]: https://palantir.github.io/tslint/rules/static-this -[`strict-boolean-expressions`]: https://palantir.github.io/tslint/rules/strict-boolean-expressions -[`strict-string-expressions`]: https://palantir.github.io/tslint/rules/strict-string-expressions -[`strict-type-predicates`]: https://palantir.github.io/tslint/rules/strict-type-predicates -[`switch-default`]: https://palantir.github.io/tslint/rules/switch-default -[`triple-equals`]: https://palantir.github.io/tslint/rules/triple-equals -[`typeof-compare`]: https://palantir.github.io/tslint/rules/typeof-compare -[`unnecessary-constructor`]: https://palantir.github.io/tslint/rules/unnecessary-constructor -[`use-default-type-parameter`]: https://palantir.github.io/tslint/rules/use-default-type-parameter -[`use-isnan`]: https://palantir.github.io/tslint/rules/use-isnan -[`cyclomatic-complexity`]: https://palantir.github.io/tslint/rules/cyclomatic-complexity -[`deprecation`]: https://palantir.github.io/tslint/rules/deprecation -[`eofline`]: https://palantir.github.io/tslint/rules/eofline -[`indent`]: https://palantir.github.io/tslint/rules/indent -[`linebreak-style`]: https://palantir.github.io/tslint/rules/linebreak-style -[`max-classes-per-file`]: https://palantir.github.io/tslint/rules/max-classes-per-file -[`max-file-line-count`]: https://palantir.github.io/tslint/rules/max-file-line-count -[`max-line-length`]: https://palantir.github.io/tslint/rules/max-line-length -[`no-default-export`]: https://palantir.github.io/tslint/rules/no-default-export -[`no-default-import`]: https://palantir.github.io/tslint/rules/no-default-import -[`no-duplicate-imports`]: https://palantir.github.io/tslint/rules/no-duplicate-imports -[`no-mergeable-namespace`]: https://palantir.github.io/tslint/rules/no-mergeable-namespace -[`no-require-imports`]: https://palantir.github.io/tslint/rules/no-require-imports -[`object-literal-sort-keys`]: https://palantir.github.io/tslint/rules/object-literal-sort-keys -[`prefer-const`]: https://palantir.github.io/tslint/rules/prefer-const -[`prefer-readonly`]: https://palantir.github.io/tslint/rules/prefer-readonly -[`trailing-comma`]: https://palantir.github.io/tslint/rules/trailing-comma -[`align`]: https://palantir.github.io/tslint/rules/align -[`array-type`]: https://palantir.github.io/tslint/rules/array-type -[`arrow-parens`]: https://palantir.github.io/tslint/rules/arrow-parens -[`arrow-return-shorthand`]: https://palantir.github.io/tslint/rules/arrow-return-shorthand -[`binary-expression-operand-order`]: https://palantir.github.io/tslint/rules/binary-expression-operand-order -[`callable-types`]: https://palantir.github.io/tslint/rules/callable-types -[`class-name`]: https://palantir.github.io/tslint/rules/class-name -[`comment-format`]: https://palantir.github.io/tslint/rules/comment-format -[`comment-type`]: https://palantir.github.io/tslint/rules/comment-type -[`completed-docs`]: https://palantir.github.io/tslint/rules/completed-docs -[`encoding`]: https://palantir.github.io/tslint/rules/encoding -[`file-header`]: https://palantir.github.io/tslint/rules/file-header -[`file-name-casing`]: https://palantir.github.io/tslint/rules/file-name-casing -[`import-spacing`]: https://palantir.github.io/tslint/rules/import-spacing -[`increment-decrement`]: https://palantir.github.io/tslint/rules/increment-decrement -[`interface-name`]: https://palantir.github.io/tslint/rules/interface-name -[`interface-over-type-literal`]: https://palantir.github.io/tslint/rules/interface-over-type-literal -[`jsdoc-format`]: https://palantir.github.io/tslint/rules/jsdoc-format -[`match-default-export-name`]: https://palantir.github.io/tslint/rules/match-default-export-name -[`newline-before-return`]: https://palantir.github.io/tslint/rules/newline-before-return -[`newline-per-chained-call`]: https://palantir.github.io/tslint/rules/newline-per-chained-call -[`new-parens`]: https://palantir.github.io/tslint/rules/new-parens -[`no-angle-bracket-type-assertion`]: https://palantir.github.io/tslint/rules/no-angle-bracket-type-assertion -[`no-boolean-literal-compare`]: https://palantir.github.io/tslint/rules/no-boolean-literal-compare -[`no-consecutive-blank-lines`]: https://palantir.github.io/tslint/rules/no-consecutive-blank-lines -[`no-irregular-whitespace`]: https://palantir.github.io/tslint/rules/no-irregular-whitespace -[`no-parameter-properties`]: https://palantir.github.io/tslint/rules/no-parameter-properties -[`no-redundant-jsdoc`]: https://palantir.github.io/tslint/rules/no-redundant-jsdoc -[`no-reference-import`]: https://palantir.github.io/tslint/rules/no-reference-import -[`no-trailing-whitespace`]: https://palantir.github.io/tslint/rules/no-trailing-whitespace -[`no-unnecessary-callback-wrapper`]: https://palantir.github.io/tslint/rules/no-unnecessary-callback-wrapper -[`no-unnecessary-else`]: https://palantir.github.io/tslint/rules/no-unnecessary-else -[`no-unnecessary-initializer`]: https://palantir.github.io/tslint/rules/no-unnecessary-initializer -[`no-unnecessary-qualifier`]: https://palantir.github.io/tslint/rules/no-unnecessary-qualifier -[`number-literal-format`]: https://palantir.github.io/tslint/rules/number-literal-format -[`object-literal-key-quotes`]: https://palantir.github.io/tslint/rules/object-literal-key-quotes -[`object-literal-shorthand`]: https://palantir.github.io/tslint/rules/object-literal-shorthand -[`one-line`]: https://palantir.github.io/tslint/rules/one-line -[`one-variable-per-declaration`]: https://palantir.github.io/tslint/rules/one-variable-per-declaration -[`ordered-imports`]: https://palantir.github.io/tslint/rules/ordered-imports -[`prefer-function-over-method`]: https://palantir.github.io/tslint/rules/prefer-function-over-method -[`prefer-method-signature`]: https://palantir.github.io/tslint/rules/prefer-method-signature -[`prefer-switch`]: https://palantir.github.io/tslint/rules/prefer-switch -[`prefer-template`]: https://palantir.github.io/tslint/rules/prefer-template -[`prefer-while`]: https://palantir.github.io/tslint/rules/prefer-while -[`quotemark`]: https://palantir.github.io/tslint/rules/quotemark -[`return-undefined`]: https://palantir.github.io/tslint/rules/return-undefined -[`semicolon`]: https://palantir.github.io/tslint/rules/semicolon -[`space-before-function-paren`]: https://palantir.github.io/tslint/rules/space-before-function-paren -[`space-within-parens`]: https://palantir.github.io/tslint/rules/space-within-parens -[`switch-final-break`]: https://palantir.github.io/tslint/rules/switch-final-break -[`type-literal-delimiter`]: https://palantir.github.io/tslint/rules/type-literal-delimiter -[`unnecessary-bind`]: https://palantir.github.io/tslint/rules/unnecessary-bind -[`variable-name`]: https://palantir.github.io/tslint/rules/variable-name -[`whitespace`]: https://palantir.github.io/tslint/rules/whitespace - - - -[no-magic-numbers]: https://eslint.org/docs/rules/no-magic-numbers -[no-param-reassign]: https://eslint.org/docs/rules/no-param-reassign -[no-sequences]: https://eslint.org/docs/rules/no-sequences -[no-restricted-globals]: https://eslint.org/docs/rules/no-restricted-globals -[no-restricted-properties]: https://eslint.org/docs/rules/no-restricted-properties -[no-restricted-syntax]: https://eslint.org/docs/rules/no-restricted-syntax -[curly]: https://eslint.org/docs/rules/curly -[guard-for-in]: https://eslint.org/docs/rules/guard-for-in -[no-new-func]: https://eslint.org/docs/rules/no-new-func -[no-restricted-imports]: https://eslint.org/docs/rules/no-restricted-imports -[no-unused-labels]: https://eslint.org/docs/rules/no-unused-labels -[no-caller]: https://eslint.org/docs/rules/no-caller -[no-bitwise]: https://eslint.org/docs/rules/no-bitwise -[no-cond-assign]: https://eslint.org/docs/rules/no-cond-assign -[no-console]: https://eslint.org/docs/rules/no-console -[no-new-wrappers]: https://eslint.org/docs/rules/no-new-wrappers -[no-debugger]: https://eslint.org/docs/rules/no-debugger -[constructor-super]: https://eslint.org/docs/rules/constructor-super -[no-duplicate-case]: https://eslint.org/docs/rules/no-duplicate-case -[no-redeclare]: https://eslint.org/docs/rules/no-redeclare -[no-empty]: https://eslint.org/docs/rules/no-empty -[no-eval]: https://eslint.org/docs/rules/no-eval -[no-template-curly-in-string]: https://eslint.org/docs/rules/no-template-curly-in-string -[no-invalid-this]: https://eslint.org/docs/rules/no-invalid-this -[no-return-await]: https://eslint.org/docs/rules/no-return-await -[no-shadow]: https://eslint.org/docs/rules/no-shadow -[no-sparse-arrays]: https://eslint.org/docs/rules/no-sparse-arrays -[dot-notation]: https://eslint.org/docs/rules/dot-notation -[no-fallthrough]: https://eslint.org/docs/rules/no-fallthrough -[no-unsafe-finally]: https://eslint.org/docs/rules/no-unsafe-finally -[no-unused-expressions]: https://eslint.org/docs/rules/no-unused-expressions -[no-var]: https://eslint.org/docs/rules/no-var -[prefer-object-spread]: https://eslint.org/docs/rules/prefer-object-spread -[radix]: https://eslint.org/docs/rules/radix -[default-case]: https://eslint.org/docs/rules/default-case -[eqeqeq]: https://eslint.org/docs/rules/eqeqeq -[valid-typeof]: https://eslint.org/docs/rules/valid-typeof -[no-useless-constructor]: https://eslint.org/docs/rules/no-useless-constructor -[use-isnan]: https://eslint.org/docs/rules/use-isnan -[complexity]: https://eslint.org/docs/rules/complexity -[eol-last]: https://eslint.org/docs/rules/eol-last -[linebreak-style]: https://eslint.org/docs/rules/linebreak-style -[max-classes-per-file]: https://eslint.org/docs/rules/max-classes-per-file -[max-lines]: https://eslint.org/docs/rules/max-lines -[max-len]: https://eslint.org/docs/rules/max-len -[sort-keys]: https://eslint.org/docs/rules/sort-keys -[prefer-const]: https://eslint.org/docs/rules/prefer-const -[comma-dangle]: https://eslint.org/docs/rules/comma-dangle -[arrow-parens]: https://eslint.org/docs/rules/arrow-parens -[arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style -[yoda]: https://eslint.org/docs/rules/yoda -[capitalized-comments]: https://eslint.org/docs/rules/capitalized-comments -[spaced-comment]: https://eslint.org/docs/rules/spaced-comment -[no-plusplus]: https://eslint.org/docs/rules/no-plusplus -[valid-jsdoc]: https://eslint.org/docs/rules/valid-jsdoc -[padding-line-between-statements]: https://eslint.org/docs/rules/padding-line-between-statements -[newline-per-chained-call]: https://eslint.org/docs/rules/newline-per-chained-call -[new-parens]: https://eslint.org/docs/rules/new-parens -[no-else-return]: https://eslint.org/docs/rules/no-else-return -[no-multiple-empty-lines]: https://eslint.org/docs/rules/no-multiple-empty-lines -[no-irregular-whitespace]: https://eslint.org/docs/rules/no-irregular-whitespace -[no-trailing-spaces]: https://eslint.org/docs/rules/no-trailing-spaces -[no-undef-init]: https://eslint.org/docs/rules/no-undef-init -[quote-props]: https://eslint.org/docs/rules/quote-props -[object-shorthand]: https://eslint.org/docs/rules/object-shorthand -[brace-style]: https://eslint.org/docs/rules/brace-style -[one-var]: https://eslint.org/docs/rules/one-var -[class-methods-use-this]: https://eslint.org/docs/rules/class-methods-use-this -[prefer-template]: https://eslint.org/docs/rules/prefer-template -[quotes]: https://eslint.org/docs/rules/quotes -[semi]: https://eslint.org/docs/rules/semi -[space-after-function-paren]: https://eslint.org/docs/rules/space-before-function-paren -[space-in-parens]: https://eslint.org/docs/rules/space-in-parens -[no-extra-bind]: https://eslint.org/docs/rules/no-extra-bind -[camelcase]: https://eslint.org/docs/rules/camelcase -[no-underscore-dangle]: https://eslint.org/docs/rules/no-underscore-dangle -[id-blacklist]: https://eslint.org/docs/rules/id-blacklist -[id-match]: https://eslint.org/docs/rules/id-match -[max-statements]: https://eslint.org/docs/rules/max-statements -[no-constant-condition]: https://eslint.org/docs/rules/no-constant-condition -[no-control-regex]: https://eslint.org/docs/rules/no-control-regex -[no-invalid-regexp]: https://eslint.org/docs/rules/no-invalid-regexp -[no-regex-spaces]: https://eslint.org/docs/rules/no-regex-spaces -[no-new-func]: https://eslint.org/docs/rules/no-new-func -[padded-blocks]: https://eslint.org/docs/rules/padded-blocks -[func-style]: https://eslint.org/docs/rules/func-style -[no-multi-str]: https://eslint.org/docs/rules/no-multi-str -[no-octal]: https://eslint.org/docs/rules/no-octal -[no-octal-escape]: https://eslint.org/docs/rules/no-octal-escape -[no-extra-semi]: https://eslint.org/docs/rules/no-extra-semi -[no-with]: https://eslint.org/docs/rules/no-with -[no-warning-comments]: https://eslint.org/docs/rules/no-warning-comments - - - -[`@typescript-eslint/adjacent-overload-signatures`]: https://typescript-eslint.io/rules/adjacent-overload-signatures -[`@typescript-eslint/await-thenable`]: https://typescript-eslint.io/rules/await-thenable -[`@typescript-eslint/ban-types`]: https://typescript-eslint.io/rules/ban-types -[`@typescript-eslint/ban-ts-comment`]: https://typescript-eslint.io/rules/ban-ts-comment -[`@typescript-eslint/consistent-type-assertions`]: https://typescript-eslint.io/rules/consistent-type-assertions -[`@typescript-eslint/consistent-type-definitions`]: https://typescript-eslint.io/rules/consistent-type-definitions -[`@typescript-eslint/explicit-member-accessibility`]: https://typescript-eslint.io/rules/explicit-member-accessibility -[`@typescript-eslint/member-ordering`]: https://typescript-eslint.io/rules/member-ordering -[`@typescript-eslint/method-signature-style`]: https://typescript-eslint.io/rules/method-signature-style -[`@typescript-eslint/no-explicit-any`]: https://typescript-eslint.io/rules/no-explicit-any -[`@typescript-eslint/no-empty-interface`]: https://typescript-eslint.io/rules/no-empty-interface -[`@typescript-eslint/no-implied-eval`]: https://typescript-eslint.io/rules/no-implied-eval -[`@typescript-eslint/no-inferrable-types`]: https://typescript-eslint.io/rules/no-inferrable-types -[`@typescript-eslint/prefer-namespace-keyword`]: https://typescript-eslint.io/rules/prefer-namespace-keyword -[`@typescript-eslint/promise-function-async`]: https://typescript-eslint.io/rules/promise-function-async -[`@typescript-eslint/no-misused-promises`]: https://typescript-eslint.io/rules/no-misused-promises -[`@typescript-eslint/no-namespace`]: https://typescript-eslint.io/rules/no-namespace -[`@typescript-eslint/no-non-null-assertion`]: https://typescript-eslint.io/rules/no-non-null-assertion -[`@typescript-eslint/triple-slash-reference`]: https://typescript-eslint.io/rules/triple-slash-reference -[`@typescript-eslint/unbound-method`]: https://typescript-eslint.io/rules/unbound-method -[`@typescript-eslint/no-unnecessary-type-assertion`]: https://typescript-eslint.io/rules/no-unnecessary-type-assertion -[`@typescript-eslint/no-var-requires`]: https://typescript-eslint.io/rules/no-var-requires -[`@typescript-eslint/type-annotation-spacing`]: https://typescript-eslint.io/rules/type-annotation-spacing -[`@typescript-eslint/typedef`]: https://typescript-eslint.io/rules/typedef -[`@typescript-eslint/unified-signatures`]: https://typescript-eslint.io/rules/unified-signatures -[`@typescript-eslint/no-unnecessary-boolean-literal-compare`]: https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare -[`@typescript-eslint/no-misused-new`]: https://typescript-eslint.io/rules/no-misused-new -[`@typescript-eslint/no-this-alias`]: https://typescript-eslint.io/rules/no-this-alias -[`@typescript-eslint/no-throw-literal`]: https://typescript-eslint.io/rules/no-throw-literal -[`@typescript-eslint/no-extraneous-class`]: https://typescript-eslint.io/rules/no-extraneous-class -[`@typescript-eslint/no-unused-vars`]: https://typescript-eslint.io/rules/no-unused-vars -[`@typescript-eslint/no-use-before-define`]: https://typescript-eslint.io/rules/no-use-before-define -[`@typescript-eslint/restrict-plus-operands`]: https://typescript-eslint.io/rules/restrict-plus-operands -[`@typescript-eslint/strict-boolean-expressions`]: https://typescript-eslint.io/rules/strict-boolean-expressions -[`@typescript-eslint/indent`]: https://typescript-eslint.io/rules/indent -[`@typescript-eslint/no-invalid-void-type`]: https://typescript-eslint.io/rules/no-invalid-void-type -[`@typescript-eslint/no-require-imports`]: https://typescript-eslint.io/rules/no-require-imports -[`@typescript-eslint/array-type`]: https://typescript-eslint.io/rules/array-type -[`@typescript-eslint/naming-convention`]: https://typescript-eslint.io/rules/naming-convention -[`@typescript-eslint/interface-name-prefix`]: https://typescript-eslint.io/rules/interface-name-prefix -[`@typescript-eslint/naming-convention`]: https://typescript-eslint.io/rules/naming-convention -[`@typescript-eslint/parameter-properties`]: https://typescript-eslint.io/rules/parameter-properties -[`@typescript-eslint/member-delimiter-style`]: https://typescript-eslint.io/rules/member-delimiter-style -[`@typescript-eslint/prefer-for-of`]: https://typescript-eslint.io/rules/prefer-for-of -[`@typescript-eslint/no-array-constructor`]: https://typescript-eslint.io/rules/no-array-constructor -[`@typescript-eslint/no-dynamic-delete`]: https://typescript-eslint.io/rules/no-dynamic-delete -[`@typescript-eslint/prefer-function-type`]: https://typescript-eslint.io/rules/prefer-function-type -[`@typescript-eslint/prefer-readonly`]: https://typescript-eslint.io/rules/prefer-readonly -[`@typescript-eslint/require-await`]: https://typescript-eslint.io/rules/require-await -[`@typescript-eslint/no-for-in-array`]: https://typescript-eslint.io/rules/no-for-in-array -[`@typescript-eslint/no-unnecessary-qualifier`]: https://typescript-eslint.io/rules/no-unnecessary-qualifier -[`@typescript-eslint/no-unnecessary-type-arguments`]: https://typescript-eslint.io/rules/no-unnecessary-type-arguments -[`@typescript-eslint/semi`]: https://typescript-eslint.io/rules/semi -[`@typescript-eslint/no-floating-promises`]: https://typescript-eslint.io/rules/no-floating-promises -[`@typescript-eslint/no-magic-numbers`]: https://typescript-eslint.io/rules/no-magic-numbers -[`@typescript-eslint/no-unsafe-member-access`]: https://typescript-eslint.io/rules/no-unsafe-member-access -[`@typescript-eslint/restrict-template-expressions`]: https://typescript-eslint.io/rules/restrict-template-expressions -[`@typescript-eslint/no-confusing-void-expression`]: https://typescript-eslint.io/rules/no-confusing-void-expression - - - -[plugin:import]: https://github.com/benmosher/eslint-plugin-import -[`import/no-unassigned-import`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md -[`import/no-extraneous-dependencies`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md -[`import/no-internal-modules`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md -[`import/no-deprecated`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md -[`import/no-default-export`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-default-export.md -[`import/no-duplicates`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md -[`import/order`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md - - - -[`react/no-danger`]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md -[`react/jsx-curly-spacing`]: https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-curly-spacing.md -[`react/jsx-no-target-blank`]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md -[`react/no-unused-state`]: https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-state.md - - - -[`jsx-a11y/anchor-is-valid`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md -[`jsx-a11y/aria-unsupported-elements`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md -[`jsx-a11y/no-static-element-interactions`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md -[`jsx-a11y/alt-text`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md -[`jsx-a11y/html-has-lang`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md -[`jsx-a11y/lang`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md -[`jsx-a11y/no-onchange`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md -[`jsx-a11y/aria-props`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md -[`jsx-a11y/aria-proptypes`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md -[`jsx-a11y/role-has-required-aria-props`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md -[`jsx-a11y/role-supports-aria-props`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md -[`jsx-a11y/aria-role`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md -[`jsx-a11y/tabindex-no-positive`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md - - - -[`security/detect-non-literal-fs-filename`]: https://github.com/nodesecurity/eslint-plugin-security#detect-non-literal-fs-filename -[`security/detect-non-literal-require`]: https://github.com/nodesecurity/eslint-plugin-security#detect-non-literal-require -[`security/detect-possible-timing-attacks`]: https://github.com/nodesecurity/eslint-plugin-security#detect-possible-timing-attacks - - - -[plugin:jsdoc]: https://github.com/gajus/eslint-plugin-jsdoc -[`jsdoc/require-jsdoc`]: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc -[`jsdoc/no-types`]: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types - - - -[`@microsoft/sdl/no-cookies`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-cookies.md -[`@microsoft/sdl/no-document-domain`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-document-domain.md -[`@microsoft/sdl/no-document-write`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-document-write.md -[`@microsoft/sdl/no-html-method`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-html-method.md -[`@microsoft/sdl/no-inner-html`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-inner-html.md -[`@microsoft/sdl/no-insecure-random`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-insecure-random.md -[`@microsoft/sdl/no-insecure-url`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-insecure-url.md -[`@microsoft/sdl/no-msapp-exec-unsafe`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-msapp-exec-unsafe.md -[`@microsoft/sdl/no-winjs-html-unsafe`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-winjs-html-unsafe.md -[`@microsoft/sdl/react-iframe-missing-sandbox`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/react-iframe-missing-sandbox.md - - - -[`prefer-arrow/prefer-arrow-functions`]: https://github.com/TristonJ/eslint-plugin-prefer-arrow -[plugin:promise]: https://github.com/xjamundx/eslint-plugin-promise -[plugin:header]: https://github.com/Stuk/eslint-plugin-header -[plugin:file-header]: https://github.com/Sekhmet/eslint-plugin-file-header -[plugin:compat]: https://github.com/amilajack/eslint-plugin-compat -[`no-null/no-null`]: https://github.com/nene/eslint-plugin-no-null -[`unicorn/filename-case`]: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/filename-case.md -[`jest/no-focused-tests`]: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-focused-tests.md -[`jsx-a11y/heading-has-content`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md -[`lodash/chaining`]: https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/chaining.md -[`deprecation/deprecation`]: https://github.com/gund/eslint-plugin-deprecation -[`desktop/insecure-random`]: https://github.com/desktop/desktop/blob/development/eslint-rules/insecure-random.js +πŸ‘‹ diff --git a/packages/eslint-plugin/TSLINT_RULE_ALTERNATIVES.md b/packages/eslint-plugin/TSLINT_RULE_ALTERNATIVES.md new file mode 100644 index 00000000000..097de893804 --- /dev/null +++ b/packages/eslint-plugin/TSLINT_RULE_ALTERNATIVES.md @@ -0,0 +1,728 @@ +# TSLint Rule Alternatives + +This document serves as a guide to help you migrate from TSLint. +It lists all TSLint rules along side rules from the ESLint ecosystem that are the same or similar. + +> For a tool that migrates a TSLint config to the closest possible ESLint config, see [`tslint-to-eslint-config`](https://github.com/typescript-eslint/tslint-to-eslint-config). + +## TSLint rules + +βœ… = done
+🌟 = in ESLint core
+πŸ”Œ = in another plugin
+πŸŒ“ = implementations differ or ESLint version is missing functionality
+πŸ›‘ = unimplemented
+ +### TypeScript-specific + +| TSLint rule | | ESLint rule | +| --------------------------------- | :-: | ---------------------------------------------------- | +| [`adjacent-overload-signatures`] | βœ… | [`@typescript-eslint/adjacent-overload-signatures`] | +| [`ban-ts-ignore`] | βœ… | [`@typescript-eslint/ban-ts-comment`] | +| [`ban-types`] | πŸŒ“ | [`@typescript-eslint/ban-types`][1] | +| [`invalid-void`] | βœ… | [`@typescript-eslint/no-invalid-void-type`] | +| [`member-access`] | βœ… | [`@typescript-eslint/explicit-member-accessibility`] | +| [`member-ordering`] | βœ… | [`@typescript-eslint/member-ordering`] | +| [`no-any`] | βœ… | [`@typescript-eslint/no-explicit-any`] | +| [`no-empty-interface`] | βœ… | [`@typescript-eslint/no-empty-interface`] | +| [`no-import-side-effect`] | πŸ”Œ | [`import/no-unassigned-import`] | +| [`no-inferrable-types`] | βœ… | [`@typescript-eslint/no-inferrable-types`] | +| [`no-internal-module`] | βœ… | [`@typescript-eslint/prefer-namespace-keyword`] | +| [`no-magic-numbers`] | βœ… | [`@typescript-eslint/no-magic-numbers`] | +| [`no-namespace`] | βœ… | [`@typescript-eslint/no-namespace`] | +| [`no-non-null-assertion`] | βœ… | [`@typescript-eslint/no-non-null-assertion`] | +| [`no-parameter-reassignment`] | βœ… | [`no-param-reassign`][no-param-reassign] | +| [`no-reference`] | βœ… | [`@typescript-eslint/triple-slash-reference`] | +| [`no-unnecessary-type-assertion`] | βœ… | [`@typescript-eslint/no-unnecessary-type-assertion`] | +| [`no-var-requires`] | βœ… | [`@typescript-eslint/no-var-requires`] | +| [`only-arrow-functions`] | πŸ”Œ | [`prefer-arrow/prefer-arrow-functions`] | +| [`prefer-for-of`] | βœ… | [`@typescript-eslint/prefer-for-of`] | +| [`promise-function-async`] | βœ… | [`@typescript-eslint/promise-function-async`] | +| [`typedef-whitespace`] | βœ… | [`@typescript-eslint/type-annotation-spacing`] | +| [`typedef`] | βœ… | [`@typescript-eslint/typedef`] | +| [`unified-signatures`] | βœ… | [`@typescript-eslint/unified-signatures`] | + +[1] The ESLint rule only supports exact string matching, rather than regular expressions
+ +### Functionality + +| TSLint rule | | ESLint rule | +| ------------------------------------ | :-: | --------------------------------------------------------------------------------------------------------- | +| [`await-promise`] | βœ… | [`@typescript-eslint/await-thenable`] | +| [`ban-comma-operator`] | 🌟 | [`no-sequences`][no-sequences] | +| [`ban`] | 🌟 | [`no-restricted-globals`][no-restricted-globals] & [`no-restricted-properties`][no-restricted-properties] | +| [`curly`] | 🌟 | [`curly`][curly] | +| [`forin`] | 🌟 | [`guard-for-in`][guard-for-in] | +| [`function-constructor`] | 🌟 | [`no-new-func`][no-new-func] | +| [`import-blacklist`] | 🌟 | [`no-restricted-imports`][no-restricted-imports] | +| [`label-position`] | 🌟 | [`no-unused-labels`][no-unused-labels] (similar) | +| [`no-arg`] | 🌟 | [`no-caller`][no-caller] (also blocks `arguments.caller`) | +| [`no-async-without-await`] | βœ… | [`@typescript-eslint/require-await`] | +| [`no-bitwise`] | 🌟 | [`no-bitwise`][no-bitwise] | +| [`no-conditional-assignment`] | 🌟 | [`no-cond-assign`][no-cond-assign][1] | +| [`no-console`] | 🌟 | [`no-console`][no-console] (configuration works slightly differently) | +| [`no-construct`] | 🌟 | [`no-new-wrappers`][no-new-wrappers] | +| [`no-debugger`] | 🌟 | [`no-debugger`][no-debugger] | +| [`no-duplicate-super`] | 🌟 | [`constructor-super`][constructor-super] | +| [`no-duplicate-switch-case`] | 🌟 | [`no-duplicate-case`][no-duplicate-case] | +| [`no-duplicate-variable`] | 🌟 | [`no-redeclare`][no-redeclare] | +| [`no-dynamic-delete`] | βœ… | [`@typescript-eslint/no-dynamic-delete`] | +| [`no-empty`] | 🌟 | [`no-empty`][no-empty] | +| [`no-eval`] | 🌟 | [`no-eval`][no-eval] | +| [`no-floating-promises`] | βœ… | [`@typescript-eslint/no-floating-promises`] | +| [`no-for-in-array`] | βœ… | [`@typescript-eslint/no-for-in-array`] | +| [`no-implicit-dependencies`] | πŸ”Œ | [`import/no-extraneous-dependencies`] | +| [`no-inferred-empty-object-type`] | πŸ›‘ | N/A | +| [`no-invalid-template-strings`] | 🌟 | [`no-template-curly-in-string`][no-template-curly-in-string] | +| [`no-invalid-this`] | 🌟 | [`no-invalid-this`][no-invalid-this] | +| [`no-misused-new`] | βœ… | [`@typescript-eslint/no-misused-new`] | +| [`no-null-keyword`] | πŸ”Œ | [`no-null/no-null`] (doesn’t handle `null` type) | +| [`no-null-undefined-union`] | πŸ›‘ | N/A | +| [`no-object-literal-type-assertion`] | βœ… | [`@typescript-eslint/consistent-type-assertions`] | +| [`no-promise-as-boolean`] | βœ… | [`@typescript-eslint/no-misused-promises`] | +| [`no-restricted-globals`] | βœ… | [`no-restricted-globals`][no-restricted-globals] | +| [`no-return-await`] | 🌟 | [`no-return-await`][no-return-await] | +| [`no-shadowed-variable`] | 🌟 | [`no-shadow`][no-shadow] | +| [`no-sparse-arrays`] | 🌟 | [`no-sparse-arrays`][no-sparse-arrays] | +| [`no-string-literal`] | 🌟 | [`dot-notation`][dot-notation] | +| [`no-string-throw`] | βœ… | [`@typescript-eslint/no-throw-literal`] | +| [`no-submodule-imports`] | πŸŒ“ | [`import/no-internal-modules`] (slightly different) | +| [`no-switch-case-fall-through`] | 🌟 | [`no-fallthrough`][no-fallthrough] | +| [`no-tautology-expression`] | πŸ›‘ | N/A | +| [`no-this-assignment`] | βœ… | [`@typescript-eslint/no-this-alias`] | +| [`no-unbound-method`] | βœ… | [`@typescript-eslint/unbound-method`] | +| [`no-unnecessary-class`] | βœ… | [`@typescript-eslint/no-extraneous-class`] | +| [`no-unsafe-any`] | πŸŒ“ | [`@typescript-eslint/no-unsafe-member-access`][2] | +| [`no-unsafe-finally`] | 🌟 | [`no-unsafe-finally`][no-unsafe-finally] | +| [`no-unused-expression`] | 🌟 | [`no-unused-expressions`][no-unused-expressions] | +| [`no-unused-variable`] | πŸŒ“ | [`@typescript-eslint/no-unused-vars`] | +| [`no-use-before-declare`] | βœ… | [`@typescript-eslint/no-use-before-define`] | +| [`no-var-keyword`] | 🌟 | [`no-var`][no-var] | +| [`no-void-expression`] | βœ… | [`@typescript-eslint/no-confusing-void-expression`] | +| [`prefer-conditional-expression`] | πŸ›‘ | N/A | +| [`prefer-object-spread`] | 🌟 | [`prefer-object-spread`][prefer-object-spread] | +| [`radix`] | 🌟 | [`radix`][radix] | +| [`restrict-plus-operands`] | βœ… | [`@typescript-eslint/restrict-plus-operands`] | +| [`static-this`] | πŸ›‘ | N/A | +| [`strict-boolean-expressions`] | βœ… | [`@typescript-eslint/strict-boolean-expressions`] | +| [`strict-string-expressions`] | βœ… | [`@typescript-eslint/restrict-plus-operands`] & [`@typescript-eslint/restrict-template-expressions`] | +| [`strict-type-predicates`] | πŸ›‘ | N/A | +| [`switch-default`] | 🌟 | [`default-case`][default-case] | +| [`triple-equals`] | 🌟 | [`eqeqeq`][eqeqeq] | +| [`typeof-compare`] | 🌟 | [`valid-typeof`][valid-typeof] | +| [`unnecessary-constructor`] | 🌟 | [`no-useless-constructor`][no-useless-constructor] | +| [`use-default-type-parameter`] | βœ… | [`@typescript-eslint/no-unnecessary-type-arguments`] | +| [`use-isnan`] | 🌟 | [`use-isnan`][use-isnan] | + +[1] The ESLint rule also supports silencing with an extra set of parentheses (`if ((foo = bar)) {}`)
+[2] Only checks member expressions + +### Maintainability + +| TSLint rule | | ESLint rule | +| ---------------------------- | :-: | -------------------------------------------------- | +| [`cyclomatic-complexity`] | 🌟 | [`complexity`][complexity] | +| [`deprecation`] | πŸ”Œ | [`deprecation/deprecation`] | +| [`eofline`] | 🌟 | [`eol-last`][eol-last] | +| [`indent`] | βœ… | [`@typescript-eslint/indent`] or [Prettier] | +| [`linebreak-style`] | 🌟 | [`linebreak-style`][linebreak-style] or [Prettier] | +| [`max-classes-per-file`] | 🌟 | [`max-classes-per-file`][max-classes-per-file] | +| [`max-file-line-count`] | 🌟 | [`max-lines`][max-lines] | +| [`max-line-length`] | 🌟 | [`max-len`][max-len] or [Prettier] | +| [`no-default-export`] | πŸ”Œ | [`import/no-default-export`] | +| [`no-default-import`] | πŸ›‘ | N/A | +| [`no-duplicate-imports`] | πŸ”Œ | [`import/no-duplicates`] | +| [`no-mergeable-namespace`] | πŸ›‘ | N/A | +| [`no-require-imports`] | βœ… | [`@typescript-eslint/no-require-imports`] | +| [`object-literal-sort-keys`] | πŸŒ“ | [`sort-keys`][sort-keys] [2] | +| [`prefer-const`] | 🌟 | [`prefer-const`][prefer-const] | +| [`prefer-readonly`] | βœ… | [`@typescript-eslint/prefer-readonly`] | +| [`trailing-comma`] | πŸŒ“ | [`comma-dangle`][comma-dangle] or [Prettier] | + +[2] Missing support for blank-line-delimited sections + +### Style + +| TSLint rule | | ESLint rule | +| ----------------------------------- | :-: | ----------------------------------------------------------------------------------- | +| [`align`] | πŸ›‘ | N/A | +| [`array-type`] | βœ… | [`@typescript-eslint/array-type`] | +| [`arrow-parens`] | 🌟 | [`arrow-parens`][arrow-parens] | +| [`arrow-return-shorthand`] | 🌟 | [`arrow-body-style`][arrow-body-style] | +| [`binary-expression-operand-order`] | 🌟 | [`yoda`][yoda] | +| [`callable-types`] | βœ… | [`@typescript-eslint/prefer-function-type`] | +| [`class-name`] | βœ… | [`@typescript-eslint/naming-convention`] | +| [`comment-format`] | 🌟 | [`capitalized-comments`][capitalized-comments] & [`spaced-comment`][spaced-comment] | +| [`comment-type`] | πŸ›‘ | N/A | +| [`completed-docs`] | πŸ”Œ | [`jsdoc/require-jsdoc`] | +| [`encoding`] | πŸ›‘ | N/A | +| [`file-header`] | πŸ”Œ | [`eslint-plugin-header`][plugin:header] or [`-file-header`][plugin:file-header] | +| [`file-name-casing`] | πŸ”Œ | [`unicorn/filename-case`] | +| [`import-spacing`] | πŸ”Œ | Use [Prettier] | +| [`increment-decrement`] | 🌟 | [`no-plusplus`][no-plusplus] | +| [`interface-name`] | βœ… | [`@typescript-eslint/interface-name-prefix`] | +| [`interface-over-type-literal`] | βœ… | [`@typescript-eslint/consistent-type-definitions`] | +| [`jsdoc-format`] | πŸŒ“ | [`valid-jsdoc`][valid-jsdoc] or [`eslint-plugin-jsdoc`][plugin:jsdoc] | +| [`match-default-export-name`] | πŸ›‘ | N/A | +| [`newline-before-return`] | 🌟 | [`padding-line-between-statements`][padding-line-between-statements] [1] | +| [`newline-per-chained-call`] | 🌟 | [`newline-per-chained-call`][newline-per-chained-call] | +| [`new-parens`] | 🌟 | [`new-parens`][new-parens] | +| [`no-angle-bracket-type-assertion`] | βœ… | [`@typescript-eslint/consistent-type-assertions`] | +| [`no-boolean-literal-compare`] | βœ… | [`@typescript-eslint/no-unnecessary-boolean-literal-compare`] | +| [`no-consecutive-blank-lines`] | 🌟 | [`no-multiple-empty-lines`][no-multiple-empty-lines] | +| [`no-irregular-whitespace`] | 🌟 | [`no-irregular-whitespace`][no-irregular-whitespace] with `skipStrings: false` | +| [`no-parameter-properties`] | βœ… | [`@typescript-eslint/parameter-properties`] | +| [`no-redundant-jsdoc`] | πŸ”Œ | [`jsdoc/no-types`] | +| [`no-reference-import`] | βœ… | [`@typescript-eslint/triple-slash-reference`] | +| [`no-trailing-whitespace`] | 🌟 | [`no-trailing-spaces`][no-trailing-spaces] | +| [`no-unnecessary-callback-wrapper`] | πŸ›‘ | N/A and this might be unsafe (i.e. with `forEach`) | +| [`no-unnecessary-else`] | 🌟 | [`no-else-return`][no-else-return] [2] | +| [`no-unnecessary-initializer`] | 🌟 | [`no-undef-init`][no-undef-init] | +| [`no-unnecessary-qualifier`] | βœ… | [`@typescript-eslint/no-unnecessary-qualifier`] | +| [`number-literal-format`] | πŸ›‘ | N/A | +| [`object-literal-key-quotes`] | 🌟 | [`quote-props`][quote-props] | +| [`object-literal-shorthand`] | 🌟 | [`object-shorthand`][object-shorthand] | +| [`one-line`] | 🌟 | [`brace-style`][brace-style] or [Prettier] | +| [`one-variable-per-declaration`] | 🌟 | [`one-var`][one-var] | +| [`ordered-imports`] | πŸŒ“ | [`import/order`] | +| [`prefer-function-over-method`] | 🌟 | [`class-methods-use-this`][class-methods-use-this] | +| [`prefer-method-signature`] | βœ… | [`@typescript-eslint/method-signature-style`] | +| [`prefer-switch`] | πŸ›‘ | N/A | +| [`prefer-template`] | 🌟 | [`prefer-template`][prefer-template] | +| [`prefer-while`] | πŸ›‘ | N/A | +| [`quotemark`] | 🌟 | [`quotes`][quotes] | +| [`return-undefined`] | πŸ›‘ | N/A | +| [`semicolon`] | πŸŒ“ | [`@typescript-eslint/semi`] | +| [`space-before-function-paren`] | 🌟 | [`space-before-function-paren`][space-after-function-paren] | +| [`space-within-parens`] | 🌟 | [`space-in-parens`][space-in-parens] | +| [`switch-final-break`] | πŸ›‘ | N/A | +| [`type-literal-delimiter`] | βœ… | [`@typescript-eslint/member-delimiter-style`] | +| [`unnecessary-bind`] | 🌟 | [`no-extra-bind`][no-extra-bind] | +| [`variable-name`] | βœ… | [`@typescript-eslint/naming-convention`] | +| [`whitespace`] | πŸ”Œ | Use [Prettier] | + +[1] Recommended config: `["error", { blankLine: "always", prev: "*", next: "return" }]`
+[2] Doesn't check other control flow statements, such as `break` or `continue`. + +## `tslint-microsoft-contrib` rules + +Rule listing is [here](https://github.com/Microsoft/tslint-microsoft-contrib#supported-rules). +Deprecated rules are excluded (`missing-jsdoc`, `missing-optional-annotation`, `no-duplicate-case`, `no-duplicate-parameter-names`, `no-function-constructor-with-string-args`, `no-increment-decrement`, `no-empty-interfaces`, `no-missing-visibility-modifiers`, `no-multiple-var-decl`, `no-reserved-keywords`, `no-stateless-class`, `no-var-self`, `no-unnecessary-bind`, and `valid-typeof`). See the docs in the link above to find out what to use instead. + +### Testing + +Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint-plugin-chai-expect-keywords), [`chai-expect`](https://github.com/Turbo87/eslint-plugin-chai-expect), [`chai-friendly`](https://github.com/ihordiachenko/eslint-plugin-chai-friendly), [`mocha`](https://github.com/lo1tuma/eslint-plugin-mocha), and [`jest`](https://github.com/jest-community/eslint-plugin-jest) + +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ---------------------------------- | :-: | ------------------------- | +| `chai-prefer-contains-to-index-of` | πŸ›‘ | N/A | +| `chai-vague-errors` | πŸ›‘ | N/A | +| `mocha-avoid-only` | πŸ”Œ | [`jest/no-focused-tests`] | +| `mocha-unneeded-done` | πŸ›‘ | N/A | + +### TypeScript + +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ------------------------------- | :-: | ---------------------------------------------------------- | +| `prefer-array-literal` | πŸŒ“ | [`@typescript-eslint/no-array-constructor`] [1] | +| `prefer-type-cast` | πŸ›‘ | N/A | + +[1] ESLint rule is slightly less strict, allowing `new Array()` and `Array(2)`. + +### Miscellaneous + +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ------------------------------------- | :-: | ---------------------------------------------------------------------- | +| `export-name` | πŸ›‘ | N/A ([relevant plugin][plugin:import]) | +| `function-name` | πŸ›‘ | N/A | +| `import-name` | πŸ›‘ | N/A ([relevant plugin][plugin:import]) | +| `informative-docs` | πŸ›‘ | N/A | +| `max-func-body-length` | 🌟 | [`max-statements`][max-statements] | +| `no-banned-terms` | 🌟 | [`no-caller`][no-caller] & [`no-eval`][no-eval] | +| `no-constant-condition` | 🌟 | [`no-constant-condition`][no-constant-condition] | +| `no-control-regex` | 🌟 | [`no-control-regex`][no-control-regex] | +| `no-delete-expression` | βœ… | [`@typescript-eslint/no-dynamic-delete`] | +| `no-empty-line-after-opening-brace` | 🌟 | [`padded-blocks`][padded-blocks] [1] or [Prettier] | +| `no-for-in` | 🌟 | [`no-restricted-syntax`][no-restricted-syntax] [2] | +| `no-function-expression` | 🌟 | [`func-style`][func-style] [3] | +| `no-invalid-regexp` | 🌟 | [`no-invalid-regexp`][no-invalid-regexp] | +| `no-multiline-string` | 🌟 | [`no-multi-str`][no-multi-str] | +| `no-octal-literal` | 🌟 | [`no-octal-escape`][no-octal-escape], see also [`no-octal`][no-octal] | +| `no-regex-spaces` | 🌟 | [`no-regex-spaces`][no-regex-spaces] | +| `no-relative-imports` | πŸ›‘ | N/A, _Not recommended by the maintainers_ | +| `no-single-line-block-comment` | πŸ›‘ | N/A | +| `no-suspicious-comment` | 🌟 | [`no-warning-comments`][no-warning-comments] [4] | +| `no-typeof-undefined` | πŸ›‘ | N/A (this actually has a valid use: checking if a variable is defined) | +| `no-unexternalized-strings` | πŸ›‘ | N/A | +| `no-unnecessary-field-initialization` | πŸŒ“ | [`no-undef-init`][no-undef-init] [5] | +| `no-unnecessary-local-variable` | πŸ›‘ | N/A | +| `no-unnecessary-override` | πŸ›‘ | N/A | +| `no-unnecessary-semicolons` | 🌟 | [`no-extra-semi`][no-extra-semi] or [Prettier] | +| `no-useless-files` | πŸ›‘ | N/A | +| `no-with-statement` | 🌟 | [`no-with`][no-with] | +| `promise-must-complete` | πŸ›‘ | N/A | +| `underscore-consistent-invocation` | πŸ”Œ | [`lodash/chaining`] | +| `use-named-parameter` | πŸ›‘ | N/A | +| `use-simple-attributes` | πŸ›‘ | N/A | + +[1] Enforces blank lines both at the beginning and end of a block
+[2] Recommended config: `["error", "ForInStatement"]`
+[3] Recommended config: `["error", "declaration", { "allowArrowFunctions": true }]`
+[4] Recommended config: `["error", { "terms": ["BUG", "HACK", "FIXME", "LATER", "LATER2", "TODO"], "location": "anywhere" }]`
+[5] Does not check class fields. + +### Security + +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ------------------------------- | :-: | ------------------------------------------------------------------------------------------- | +| `insecure-random` | πŸ”Œ | [`desktop/insecure-random`] or [`@microsoft/sdl/no-insecure-random`] | +| `no-disable-auto-sanitization` | πŸ”Œ | [`@microsoft/sdl/no-msapp-exec-unsafe`] and [`@microsoft/sdl/no-winjs-html-unsafe`] | +| `no-document-domain` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-document-domain`] | +| `no-http-string` | πŸ”Œ | [`@microsoft/sdl/no-insecure-url`] | +| `no-inner-html` | πŸ”Œ | [`@microsoft/sdl/no-inner-html`] and [`@microsoft/sdl/no-html-method`] | +| `no-string-based-set-immediate` | πŸŒ“ | [`@typescript-eslint/no-implied-eval`] | +| `no-string-based-set-interval` | πŸŒ“ | [`@typescript-eslint/no-implied-eval`] | +| `no-string-based-set-timeout` | πŸŒ“ | [`@typescript-eslint/no-implied-eval`] | +| `react-anchor-blank-noopener` | πŸ”Œ | [`react/jsx-no-target-blank`] | +| `react-iframe-missing-sandbox` | πŸ”Œ | [`@microsoft/sdl/react-iframe-missing-sandbox`] | +| `react-no-dangerous-html` | πŸ”Œ | [`react/no-danger`] | +| `non-literal-fs-path` | πŸ”Œ | [`security/detect-non-literal-fs-filename`] | +| `non-literal-require` | πŸ”Œ | [`security/detect-non-literal-require`] | +| `possible-timing-attack` | πŸ”Œ | [`security/detect-possible-timing-attacks`] | + +### Browser + +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ----------------------------------- | :-: | -------------------------------------------------------------------------------------------- | +| `jquery-deferred-must-complete` | πŸ›‘ | N/A | +| `no-backbone-get-set-outside-model` | πŸ›‘ | N/A | +| `no-cookies` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-cookies`] | +| `no-document-write` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-document-write`] | +| `no-exec-script` | πŸŒ“ | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@typescript-eslint/no-implied-eval`] | +| `no-jquery-raw-elements` | πŸ›‘ | N/A | +| `no-unsupported-browser-code` | πŸ›‘ | N/A | +| `react-this-binding-issue` | πŸ›‘ | N/A | +| `react-tsx-curly-spacing` | πŸ”Œ | [`react/jsx-curly-spacing`] | +| `react-unused-props-and-state` | πŸŒ“ | [`react/no-unused-state`] | + +### React A11y + +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ----------------------------------------- | :-: | ---------------------------------------------------------- | +| `react-a11y-accessible-headings` | πŸŒ“ | [`jsx-a11y/heading-has-content`] [1] | +| `react-a11y-anchors` | πŸ”Œ | [`jsx-a11y/anchor-is-valid`] | +| `react-a11y-aria-unsupported-elements` | πŸ”Œ | [`jsx-a11y/aria-unsupported-elements`] | +| `react-a11y-event-has-role` | πŸŒ“ | [`jsx-a11y/no-static-element-interactions`] [2] | +| `react-a11y-image-button-has-alt` | πŸ”Œ | [`jsx-a11y/alt-text`] | +| `react-a11y-img-has-alt` | πŸ”Œ | [`jsx-a11y/alt-text`] | +| `react-a11y-input-elements` | πŸ›‘ | N/A | +| `react-a11y-lang` | πŸ”Œ | [`jsx-a11y/lang`] | +| `react-a11y-meta` | πŸ›‘ | N/A | +| `react-a11y-no-onchange` | πŸ”Œ | [`jsx-a11y/no-onchange`] | +| `react-a11y-props` | πŸ”Œ | [`jsx-a11y/aria-props`] | +| `react-a11y-proptypes` | πŸ”Œ | [`jsx-a11y/aria-proptypes`] | +| `react-a11y-required` | πŸ›‘ | N/A | +| `react-a11y-role-has-required-aria-props` | πŸ”Œ | [`jsx-a11y/role-has-required-aria-props`] | +| `react-a11y-role-supports-aria-props` | πŸ”Œ | [`jsx-a11y/role-supports-aria-props`] | +| `react-a11y-role` | πŸ”Œ | [`jsx-a11y/aria-role`] | +| `react-a11y-tabindex-no-positive` | πŸ”Œ | [`jsx-a11y/tabindex-no-positive`] | +| `react-a11y-titles` | πŸ›‘ | N/A | + +[1] TSLint rule is more strict
+[2] ESLint rule only reports for click handlers + +[prettier]: https://prettier.io + + + +[`adjacent-overload-signatures`]: https://palantir.github.io/tslint/rules/adjacent-overload-signatures +[`ban-ts-ignore`]: https://palantir.github.io/tslint/rules/ban-ts-ignore/ +[`ban-types`]: https://palantir.github.io/tslint/rules/ban-types +[`invalid-void`]: https://palantir.github.io/tslint/rules/invalid-void +[`member-access`]: https://palantir.github.io/tslint/rules/member-access +[`member-ordering`]: https://palantir.github.io/tslint/rules/member-ordering +[`no-any`]: https://palantir.github.io/tslint/rules/no-any +[`no-empty-interface`]: https://palantir.github.io/tslint/rules/no-empty-interface +[`no-import-side-effect`]: https://palantir.github.io/tslint/rules/no-import-side-effect +[`no-inferrable-types`]: https://palantir.github.io/tslint/rules/no-inferrable-types +[`no-internal-module`]: https://palantir.github.io/tslint/rules/no-internal-module +[`no-magic-numbers`]: https://palantir.github.io/tslint/rules/no-magic-numbers +[`no-namespace`]: https://palantir.github.io/tslint/rules/no-namespace +[`no-non-null-assertion`]: https://palantir.github.io/tslint/rules/no-non-null-assertion +[`no-parameter-reassignment`]: https://palantir.github.io/tslint/rules/no-parameter-reassignment +[`no-reference`]: https://palantir.github.io/tslint/rules/no-reference +[`no-unnecessary-type-assertion`]: https://palantir.github.io/tslint/rules/no-unnecessary-type-assertion +[`no-var-requires`]: https://palantir.github.io/tslint/rules/no-var-requires +[`only-arrow-functions`]: https://palantir.github.io/tslint/rules/only-arrow-functions +[`prefer-for-of`]: https://palantir.github.io/tslint/rules/prefer-for-of +[`promise-function-async`]: https://palantir.github.io/tslint/rules/promise-function-async +[`typedef`]: https://palantir.github.io/tslint/rules/typedef +[`typedef-whitespace`]: https://palantir.github.io/tslint/rules/typedef-whitespace +[`unified-signatures`]: https://palantir.github.io/tslint/rules/unified-signatures +[`await-promise`]: https://palantir.github.io/tslint/rules/await-promise +[`ban-comma-operator`]: https://palantir.github.io/tslint/rules/ban-comma-operator +[`ban`]: https://palantir.github.io/tslint/rules/ban +[`curly`]: https://palantir.github.io/tslint/rules/curly +[`forin`]: https://palantir.github.io/tslint/rules/forin +[`function-constructor`]: https://palantir.github.io/tslint/rules/function-constructor +[`import-blacklist`]: https://palantir.github.io/tslint/rules/import-blacklist +[`label-position`]: https://palantir.github.io/tslint/rules/label-position +[`no-arg`]: https://palantir.github.io/tslint/rules/no-arg +[`no-async-without-await`]: https://palantir.github.io/tslint/rules/no-async-without-await +[`no-bitwise`]: https://palantir.github.io/tslint/rules/no-bitwise +[`no-conditional-assignment`]: https://palantir.github.io/tslint/rules/no-conditional-assignment +[`no-console`]: https://palantir.github.io/tslint/rules/no-console +[`no-construct`]: https://palantir.github.io/tslint/rules/no-construct +[`no-debugger`]: https://palantir.github.io/tslint/rules/no-debugger +[`no-duplicate-super`]: https://palantir.github.io/tslint/rules/no-duplicate-super +[`no-duplicate-switch-case`]: https://palantir.github.io/tslint/rules/no-duplicate-switch-case +[`no-duplicate-variable`]: https://palantir.github.io/tslint/rules/no-duplicate-variable +[`no-dynamic-delete`]: https://palantir.github.io/tslint/rules/no-dynamic-delete +[`no-empty`]: https://palantir.github.io/tslint/rules/no-empty +[`no-eval`]: https://palantir.github.io/tslint/rules/no-eval +[`no-floating-promises`]: https://palantir.github.io/tslint/rules/no-floating-promises +[`no-for-in-array`]: https://palantir.github.io/tslint/rules/no-for-in-array +[`no-implicit-dependencies`]: https://palantir.github.io/tslint/rules/no-implicit-dependencies +[`no-inferred-empty-object-type`]: https://palantir.github.io/tslint/rules/no-inferred-empty-object-type +[`no-invalid-template-strings`]: https://palantir.github.io/tslint/rules/no-invalid-template-strings +[`no-invalid-this`]: https://palantir.github.io/tslint/rules/no-invalid-this +[`no-misused-new`]: https://palantir.github.io/tslint/rules/no-misused-new +[`no-null-keyword`]: https://palantir.github.io/tslint/rules/no-null-keyword +[`no-null-undefined-union`]: https://palantir.github.io/tslint/rules/no-null-undefined-union +[`no-object-literal-type-assertion`]: https://palantir.github.io/tslint/rules/no-object-literal-type-assertion +[`no-promise-as-boolean`]: https://palantir.github.io/tslint/rules/no-promise-as-boolean +[`no-restricted-globals`]: https://palantir.github.io/tslint/rules/no-restricted-globals +[`no-return-await`]: https://palantir.github.io/tslint/rules/no-return-await +[`no-shadowed-variable`]: https://palantir.github.io/tslint/rules/no-shadowed-variable +[`no-sparse-arrays`]: https://palantir.github.io/tslint/rules/no-sparse-arrays +[`no-string-literal`]: https://palantir.github.io/tslint/rules/no-string-literal +[`no-string-throw`]: https://palantir.github.io/tslint/rules/no-string-throw +[`no-submodule-imports`]: https://palantir.github.io/tslint/rules/no-submodule-imports +[`no-switch-case-fall-through`]: https://palantir.github.io/tslint/rules/no-switch-case-fall-through +[`no-tautology-expression`]: https://palantir.github.io/tslint/rules/no-tautology-expression +[`no-this-assignment`]: https://palantir.github.io/tslint/rules/no-this-assignment +[`no-unbound-method`]: https://palantir.github.io/tslint/rules/no-unbound-method +[`no-unnecessary-class`]: https://palantir.github.io/tslint/rules/no-unnecessary-class +[`no-unsafe-any`]: https://palantir.github.io/tslint/rules/no-unsafe-any +[`no-unsafe-finally`]: https://palantir.github.io/tslint/rules/no-unsafe-finally +[`no-unused-expression`]: https://palantir.github.io/tslint/rules/no-unused-expression +[`no-unused-variable`]: https://palantir.github.io/tslint/rules/no-unused-variable +[`no-use-before-declare`]: https://palantir.github.io/tslint/rules/no-use-before-declare +[`no-var-keyword`]: https://palantir.github.io/tslint/rules/no-var-keyword +[`no-void-expression`]: https://palantir.github.io/tslint/rules/no-void-expression +[`prefer-conditional-expression`]: https://palantir.github.io/tslint/rules/prefer-conditional-expression +[`prefer-object-spread`]: https://palantir.github.io/tslint/rules/prefer-object-spread +[`radix`]: https://palantir.github.io/tslint/rules/radix +[`restrict-plus-operands`]: https://palantir.github.io/tslint/rules/restrict-plus-operands +[`static-this`]: https://palantir.github.io/tslint/rules/static-this +[`strict-boolean-expressions`]: https://palantir.github.io/tslint/rules/strict-boolean-expressions +[`strict-string-expressions`]: https://palantir.github.io/tslint/rules/strict-string-expressions +[`strict-type-predicates`]: https://palantir.github.io/tslint/rules/strict-type-predicates +[`switch-default`]: https://palantir.github.io/tslint/rules/switch-default +[`triple-equals`]: https://palantir.github.io/tslint/rules/triple-equals +[`typeof-compare`]: https://palantir.github.io/tslint/rules/typeof-compare +[`unnecessary-constructor`]: https://palantir.github.io/tslint/rules/unnecessary-constructor +[`use-default-type-parameter`]: https://palantir.github.io/tslint/rules/use-default-type-parameter +[`use-isnan`]: https://palantir.github.io/tslint/rules/use-isnan +[`cyclomatic-complexity`]: https://palantir.github.io/tslint/rules/cyclomatic-complexity +[`deprecation`]: https://palantir.github.io/tslint/rules/deprecation +[`eofline`]: https://palantir.github.io/tslint/rules/eofline +[`indent`]: https://palantir.github.io/tslint/rules/indent +[`linebreak-style`]: https://palantir.github.io/tslint/rules/linebreak-style +[`max-classes-per-file`]: https://palantir.github.io/tslint/rules/max-classes-per-file +[`max-file-line-count`]: https://palantir.github.io/tslint/rules/max-file-line-count +[`max-line-length`]: https://palantir.github.io/tslint/rules/max-line-length +[`no-default-export`]: https://palantir.github.io/tslint/rules/no-default-export +[`no-default-import`]: https://palantir.github.io/tslint/rules/no-default-import +[`no-duplicate-imports`]: https://palantir.github.io/tslint/rules/no-duplicate-imports +[`no-mergeable-namespace`]: https://palantir.github.io/tslint/rules/no-mergeable-namespace +[`no-require-imports`]: https://palantir.github.io/tslint/rules/no-require-imports +[`object-literal-sort-keys`]: https://palantir.github.io/tslint/rules/object-literal-sort-keys +[`prefer-const`]: https://palantir.github.io/tslint/rules/prefer-const +[`prefer-readonly`]: https://palantir.github.io/tslint/rules/prefer-readonly +[`trailing-comma`]: https://palantir.github.io/tslint/rules/trailing-comma +[`align`]: https://palantir.github.io/tslint/rules/align +[`array-type`]: https://palantir.github.io/tslint/rules/array-type +[`arrow-parens`]: https://palantir.github.io/tslint/rules/arrow-parens +[`arrow-return-shorthand`]: https://palantir.github.io/tslint/rules/arrow-return-shorthand +[`binary-expression-operand-order`]: https://palantir.github.io/tslint/rules/binary-expression-operand-order +[`callable-types`]: https://palantir.github.io/tslint/rules/callable-types +[`class-name`]: https://palantir.github.io/tslint/rules/class-name +[`comment-format`]: https://palantir.github.io/tslint/rules/comment-format +[`comment-type`]: https://palantir.github.io/tslint/rules/comment-type +[`completed-docs`]: https://palantir.github.io/tslint/rules/completed-docs +[`encoding`]: https://palantir.github.io/tslint/rules/encoding +[`file-header`]: https://palantir.github.io/tslint/rules/file-header +[`file-name-casing`]: https://palantir.github.io/tslint/rules/file-name-casing +[`import-spacing`]: https://palantir.github.io/tslint/rules/import-spacing +[`increment-decrement`]: https://palantir.github.io/tslint/rules/increment-decrement +[`interface-name`]: https://palantir.github.io/tslint/rules/interface-name +[`interface-over-type-literal`]: https://palantir.github.io/tslint/rules/interface-over-type-literal +[`jsdoc-format`]: https://palantir.github.io/tslint/rules/jsdoc-format +[`match-default-export-name`]: https://palantir.github.io/tslint/rules/match-default-export-name +[`newline-before-return`]: https://palantir.github.io/tslint/rules/newline-before-return +[`newline-per-chained-call`]: https://palantir.github.io/tslint/rules/newline-per-chained-call +[`new-parens`]: https://palantir.github.io/tslint/rules/new-parens +[`no-angle-bracket-type-assertion`]: https://palantir.github.io/tslint/rules/no-angle-bracket-type-assertion +[`no-boolean-literal-compare`]: https://palantir.github.io/tslint/rules/no-boolean-literal-compare +[`no-consecutive-blank-lines`]: https://palantir.github.io/tslint/rules/no-consecutive-blank-lines +[`no-irregular-whitespace`]: https://palantir.github.io/tslint/rules/no-irregular-whitespace +[`no-parameter-properties`]: https://palantir.github.io/tslint/rules/no-parameter-properties +[`no-redundant-jsdoc`]: https://palantir.github.io/tslint/rules/no-redundant-jsdoc +[`no-reference-import`]: https://palantir.github.io/tslint/rules/no-reference-import +[`no-trailing-whitespace`]: https://palantir.github.io/tslint/rules/no-trailing-whitespace +[`no-unnecessary-callback-wrapper`]: https://palantir.github.io/tslint/rules/no-unnecessary-callback-wrapper +[`no-unnecessary-else`]: https://palantir.github.io/tslint/rules/no-unnecessary-else +[`no-unnecessary-initializer`]: https://palantir.github.io/tslint/rules/no-unnecessary-initializer +[`no-unnecessary-qualifier`]: https://palantir.github.io/tslint/rules/no-unnecessary-qualifier +[`number-literal-format`]: https://palantir.github.io/tslint/rules/number-literal-format +[`object-literal-key-quotes`]: https://palantir.github.io/tslint/rules/object-literal-key-quotes +[`object-literal-shorthand`]: https://palantir.github.io/tslint/rules/object-literal-shorthand +[`one-line`]: https://palantir.github.io/tslint/rules/one-line +[`one-variable-per-declaration`]: https://palantir.github.io/tslint/rules/one-variable-per-declaration +[`ordered-imports`]: https://palantir.github.io/tslint/rules/ordered-imports +[`prefer-function-over-method`]: https://palantir.github.io/tslint/rules/prefer-function-over-method +[`prefer-method-signature`]: https://palantir.github.io/tslint/rules/prefer-method-signature +[`prefer-switch`]: https://palantir.github.io/tslint/rules/prefer-switch +[`prefer-template`]: https://palantir.github.io/tslint/rules/prefer-template +[`prefer-while`]: https://palantir.github.io/tslint/rules/prefer-while +[`quotemark`]: https://palantir.github.io/tslint/rules/quotemark +[`return-undefined`]: https://palantir.github.io/tslint/rules/return-undefined +[`semicolon`]: https://palantir.github.io/tslint/rules/semicolon +[`space-before-function-paren`]: https://palantir.github.io/tslint/rules/space-before-function-paren +[`space-within-parens`]: https://palantir.github.io/tslint/rules/space-within-parens +[`switch-final-break`]: https://palantir.github.io/tslint/rules/switch-final-break +[`type-literal-delimiter`]: https://palantir.github.io/tslint/rules/type-literal-delimiter +[`unnecessary-bind`]: https://palantir.github.io/tslint/rules/unnecessary-bind +[`variable-name`]: https://palantir.github.io/tslint/rules/variable-name +[`whitespace`]: https://palantir.github.io/tslint/rules/whitespace + + + +[no-magic-numbers]: https://eslint.org/docs/rules/no-magic-numbers +[no-param-reassign]: https://eslint.org/docs/rules/no-param-reassign +[no-sequences]: https://eslint.org/docs/rules/no-sequences +[no-restricted-globals]: https://eslint.org/docs/rules/no-restricted-globals +[no-restricted-properties]: https://eslint.org/docs/rules/no-restricted-properties +[no-restricted-syntax]: https://eslint.org/docs/rules/no-restricted-syntax +[curly]: https://eslint.org/docs/rules/curly +[guard-for-in]: https://eslint.org/docs/rules/guard-for-in +[no-new-func]: https://eslint.org/docs/rules/no-new-func +[no-restricted-imports]: https://eslint.org/docs/rules/no-restricted-imports +[no-unused-labels]: https://eslint.org/docs/rules/no-unused-labels +[no-caller]: https://eslint.org/docs/rules/no-caller +[no-bitwise]: https://eslint.org/docs/rules/no-bitwise +[no-cond-assign]: https://eslint.org/docs/rules/no-cond-assign +[no-console]: https://eslint.org/docs/rules/no-console +[no-new-wrappers]: https://eslint.org/docs/rules/no-new-wrappers +[no-debugger]: https://eslint.org/docs/rules/no-debugger +[constructor-super]: https://eslint.org/docs/rules/constructor-super +[no-duplicate-case]: https://eslint.org/docs/rules/no-duplicate-case +[no-redeclare]: https://eslint.org/docs/rules/no-redeclare +[no-empty]: https://eslint.org/docs/rules/no-empty +[no-eval]: https://eslint.org/docs/rules/no-eval +[no-template-curly-in-string]: https://eslint.org/docs/rules/no-template-curly-in-string +[no-invalid-this]: https://eslint.org/docs/rules/no-invalid-this +[no-return-await]: https://eslint.org/docs/rules/no-return-await +[no-shadow]: https://eslint.org/docs/rules/no-shadow +[no-sparse-arrays]: https://eslint.org/docs/rules/no-sparse-arrays +[dot-notation]: https://eslint.org/docs/rules/dot-notation +[no-fallthrough]: https://eslint.org/docs/rules/no-fallthrough +[no-unsafe-finally]: https://eslint.org/docs/rules/no-unsafe-finally +[no-unused-expressions]: https://eslint.org/docs/rules/no-unused-expressions +[no-var]: https://eslint.org/docs/rules/no-var +[prefer-object-spread]: https://eslint.org/docs/rules/prefer-object-spread +[radix]: https://eslint.org/docs/rules/radix +[default-case]: https://eslint.org/docs/rules/default-case +[eqeqeq]: https://eslint.org/docs/rules/eqeqeq +[valid-typeof]: https://eslint.org/docs/rules/valid-typeof +[no-useless-constructor]: https://eslint.org/docs/rules/no-useless-constructor +[use-isnan]: https://eslint.org/docs/rules/use-isnan +[complexity]: https://eslint.org/docs/rules/complexity +[eol-last]: https://eslint.org/docs/rules/eol-last +[linebreak-style]: https://eslint.org/docs/rules/linebreak-style +[max-classes-per-file]: https://eslint.org/docs/rules/max-classes-per-file +[max-lines]: https://eslint.org/docs/rules/max-lines +[max-len]: https://eslint.org/docs/rules/max-len +[sort-keys]: https://eslint.org/docs/rules/sort-keys +[prefer-const]: https://eslint.org/docs/rules/prefer-const +[comma-dangle]: https://eslint.org/docs/rules/comma-dangle +[arrow-parens]: https://eslint.org/docs/rules/arrow-parens +[arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style +[yoda]: https://eslint.org/docs/rules/yoda +[capitalized-comments]: https://eslint.org/docs/rules/capitalized-comments +[spaced-comment]: https://eslint.org/docs/rules/spaced-comment +[no-plusplus]: https://eslint.org/docs/rules/no-plusplus +[valid-jsdoc]: https://eslint.org/docs/rules/valid-jsdoc +[padding-line-between-statements]: https://eslint.org/docs/rules/padding-line-between-statements +[newline-per-chained-call]: https://eslint.org/docs/rules/newline-per-chained-call +[new-parens]: https://eslint.org/docs/rules/new-parens +[no-else-return]: https://eslint.org/docs/rules/no-else-return +[no-multiple-empty-lines]: https://eslint.org/docs/rules/no-multiple-empty-lines +[no-irregular-whitespace]: https://eslint.org/docs/rules/no-irregular-whitespace +[no-trailing-spaces]: https://eslint.org/docs/rules/no-trailing-spaces +[no-undef-init]: https://eslint.org/docs/rules/no-undef-init +[quote-props]: https://eslint.org/docs/rules/quote-props +[object-shorthand]: https://eslint.org/docs/rules/object-shorthand +[brace-style]: https://eslint.org/docs/rules/brace-style +[one-var]: https://eslint.org/docs/rules/one-var +[class-methods-use-this]: https://eslint.org/docs/rules/class-methods-use-this +[prefer-template]: https://eslint.org/docs/rules/prefer-template +[quotes]: https://eslint.org/docs/rules/quotes +[semi]: https://eslint.org/docs/rules/semi +[space-after-function-paren]: https://eslint.org/docs/rules/space-before-function-paren +[space-in-parens]: https://eslint.org/docs/rules/space-in-parens +[no-extra-bind]: https://eslint.org/docs/rules/no-extra-bind +[camelcase]: https://eslint.org/docs/rules/camelcase +[no-underscore-dangle]: https://eslint.org/docs/rules/no-underscore-dangle +[id-blacklist]: https://eslint.org/docs/rules/id-blacklist +[id-match]: https://eslint.org/docs/rules/id-match +[max-statements]: https://eslint.org/docs/rules/max-statements +[no-constant-condition]: https://eslint.org/docs/rules/no-constant-condition +[no-control-regex]: https://eslint.org/docs/rules/no-control-regex +[no-invalid-regexp]: https://eslint.org/docs/rules/no-invalid-regexp +[no-regex-spaces]: https://eslint.org/docs/rules/no-regex-spaces +[no-new-func]: https://eslint.org/docs/rules/no-new-func +[padded-blocks]: https://eslint.org/docs/rules/padded-blocks +[func-style]: https://eslint.org/docs/rules/func-style +[no-multi-str]: https://eslint.org/docs/rules/no-multi-str +[no-octal]: https://eslint.org/docs/rules/no-octal +[no-octal-escape]: https://eslint.org/docs/rules/no-octal-escape +[no-extra-semi]: https://eslint.org/docs/rules/no-extra-semi +[no-with]: https://eslint.org/docs/rules/no-with +[no-warning-comments]: https://eslint.org/docs/rules/no-warning-comments + + + +[`@typescript-eslint/adjacent-overload-signatures`]: https://typescript-eslint.io/rules/adjacent-overload-signatures +[`@typescript-eslint/await-thenable`]: https://typescript-eslint.io/rules/await-thenable +[`@typescript-eslint/ban-types`]: https://typescript-eslint.io/rules/ban-types +[`@typescript-eslint/ban-ts-comment`]: https://typescript-eslint.io/rules/ban-ts-comment +[`@typescript-eslint/consistent-type-assertions`]: https://typescript-eslint.io/rules/consistent-type-assertions +[`@typescript-eslint/consistent-type-definitions`]: https://typescript-eslint.io/rules/consistent-type-definitions +[`@typescript-eslint/explicit-member-accessibility`]: https://typescript-eslint.io/rules/explicit-member-accessibility +[`@typescript-eslint/member-ordering`]: https://typescript-eslint.io/rules/member-ordering +[`@typescript-eslint/method-signature-style`]: https://typescript-eslint.io/rules/method-signature-style +[`@typescript-eslint/no-explicit-any`]: https://typescript-eslint.io/rules/no-explicit-any +[`@typescript-eslint/no-empty-interface`]: https://typescript-eslint.io/rules/no-empty-interface +[`@typescript-eslint/no-implied-eval`]: https://typescript-eslint.io/rules/no-implied-eval +[`@typescript-eslint/no-inferrable-types`]: https://typescript-eslint.io/rules/no-inferrable-types +[`@typescript-eslint/prefer-namespace-keyword`]: https://typescript-eslint.io/rules/prefer-namespace-keyword +[`@typescript-eslint/promise-function-async`]: https://typescript-eslint.io/rules/promise-function-async +[`@typescript-eslint/no-misused-promises`]: https://typescript-eslint.io/rules/no-misused-promises +[`@typescript-eslint/no-namespace`]: https://typescript-eslint.io/rules/no-namespace +[`@typescript-eslint/no-non-null-assertion`]: https://typescript-eslint.io/rules/no-non-null-assertion +[`@typescript-eslint/triple-slash-reference`]: https://typescript-eslint.io/rules/triple-slash-reference +[`@typescript-eslint/unbound-method`]: https://typescript-eslint.io/rules/unbound-method +[`@typescript-eslint/no-unnecessary-type-assertion`]: https://typescript-eslint.io/rules/no-unnecessary-type-assertion +[`@typescript-eslint/no-var-requires`]: https://typescript-eslint.io/rules/no-var-requires +[`@typescript-eslint/type-annotation-spacing`]: https://typescript-eslint.io/rules/type-annotation-spacing +[`@typescript-eslint/typedef`]: https://typescript-eslint.io/rules/typedef +[`@typescript-eslint/unified-signatures`]: https://typescript-eslint.io/rules/unified-signatures +[`@typescript-eslint/no-unnecessary-boolean-literal-compare`]: https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare +[`@typescript-eslint/no-misused-new`]: https://typescript-eslint.io/rules/no-misused-new +[`@typescript-eslint/no-this-alias`]: https://typescript-eslint.io/rules/no-this-alias +[`@typescript-eslint/no-throw-literal`]: https://typescript-eslint.io/rules/no-throw-literal +[`@typescript-eslint/no-extraneous-class`]: https://typescript-eslint.io/rules/no-extraneous-class +[`@typescript-eslint/no-unused-vars`]: https://typescript-eslint.io/rules/no-unused-vars +[`@typescript-eslint/no-use-before-define`]: https://typescript-eslint.io/rules/no-use-before-define +[`@typescript-eslint/restrict-plus-operands`]: https://typescript-eslint.io/rules/restrict-plus-operands +[`@typescript-eslint/strict-boolean-expressions`]: https://typescript-eslint.io/rules/strict-boolean-expressions +[`@typescript-eslint/indent`]: https://typescript-eslint.io/rules/indent +[`@typescript-eslint/no-invalid-void-type`]: https://typescript-eslint.io/rules/no-invalid-void-type +[`@typescript-eslint/no-require-imports`]: https://typescript-eslint.io/rules/no-require-imports +[`@typescript-eslint/array-type`]: https://typescript-eslint.io/rules/array-type +[`@typescript-eslint/naming-convention`]: https://typescript-eslint.io/rules/naming-convention +[`@typescript-eslint/interface-name-prefix`]: https://typescript-eslint.io/rules/interface-name-prefix +[`@typescript-eslint/naming-convention`]: https://typescript-eslint.io/rules/naming-convention +[`@typescript-eslint/parameter-properties`]: https://typescript-eslint.io/rules/parameter-properties +[`@typescript-eslint/member-delimiter-style`]: https://typescript-eslint.io/rules/member-delimiter-style +[`@typescript-eslint/prefer-for-of`]: https://typescript-eslint.io/rules/prefer-for-of +[`@typescript-eslint/no-array-constructor`]: https://typescript-eslint.io/rules/no-array-constructor +[`@typescript-eslint/no-dynamic-delete`]: https://typescript-eslint.io/rules/no-dynamic-delete +[`@typescript-eslint/prefer-function-type`]: https://typescript-eslint.io/rules/prefer-function-type +[`@typescript-eslint/prefer-readonly`]: https://typescript-eslint.io/rules/prefer-readonly +[`@typescript-eslint/require-await`]: https://typescript-eslint.io/rules/require-await +[`@typescript-eslint/no-for-in-array`]: https://typescript-eslint.io/rules/no-for-in-array +[`@typescript-eslint/no-unnecessary-qualifier`]: https://typescript-eslint.io/rules/no-unnecessary-qualifier +[`@typescript-eslint/no-unnecessary-type-arguments`]: https://typescript-eslint.io/rules/no-unnecessary-type-arguments +[`@typescript-eslint/semi`]: https://typescript-eslint.io/rules/semi +[`@typescript-eslint/no-floating-promises`]: https://typescript-eslint.io/rules/no-floating-promises +[`@typescript-eslint/no-magic-numbers`]: https://typescript-eslint.io/rules/no-magic-numbers +[`@typescript-eslint/no-unsafe-member-access`]: https://typescript-eslint.io/rules/no-unsafe-member-access +[`@typescript-eslint/restrict-template-expressions`]: https://typescript-eslint.io/rules/restrict-template-expressions +[`@typescript-eslint/no-confusing-void-expression`]: https://typescript-eslint.io/rules/no-confusing-void-expression + + + +[plugin:import]: https://github.com/benmosher/eslint-plugin-import +[`import/no-unassigned-import`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md +[`import/no-extraneous-dependencies`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md +[`import/no-internal-modules`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md +[`import/no-deprecated`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md +[`import/no-default-export`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-default-export.md +[`import/no-duplicates`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md +[`import/order`]: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md + + + +[`react/no-danger`]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md +[`react/jsx-curly-spacing`]: https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-curly-spacing.md +[`react/jsx-no-target-blank`]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md +[`react/no-unused-state`]: https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-state.md + + + +[`jsx-a11y/anchor-is-valid`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md +[`jsx-a11y/aria-unsupported-elements`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md +[`jsx-a11y/no-static-element-interactions`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md +[`jsx-a11y/alt-text`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md +[`jsx-a11y/html-has-lang`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md +[`jsx-a11y/lang`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md +[`jsx-a11y/no-onchange`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md +[`jsx-a11y/aria-props`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md +[`jsx-a11y/aria-proptypes`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md +[`jsx-a11y/role-has-required-aria-props`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md +[`jsx-a11y/role-supports-aria-props`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md +[`jsx-a11y/aria-role`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md +[`jsx-a11y/tabindex-no-positive`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md + + + +[`security/detect-non-literal-fs-filename`]: https://github.com/nodesecurity/eslint-plugin-security#detect-non-literal-fs-filename +[`security/detect-non-literal-require`]: https://github.com/nodesecurity/eslint-plugin-security#detect-non-literal-require +[`security/detect-possible-timing-attacks`]: https://github.com/nodesecurity/eslint-plugin-security#detect-possible-timing-attacks + + + +[plugin:jsdoc]: https://github.com/gajus/eslint-plugin-jsdoc +[`jsdoc/require-jsdoc`]: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc +[`jsdoc/no-types`]: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types + + + +[`@microsoft/sdl/no-cookies`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-cookies.md +[`@microsoft/sdl/no-document-domain`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-document-domain.md +[`@microsoft/sdl/no-document-write`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-document-write.md +[`@microsoft/sdl/no-html-method`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-html-method.md +[`@microsoft/sdl/no-inner-html`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-inner-html.md +[`@microsoft/sdl/no-insecure-random`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-insecure-random.md +[`@microsoft/sdl/no-insecure-url`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-insecure-url.md +[`@microsoft/sdl/no-msapp-exec-unsafe`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-msapp-exec-unsafe.md +[`@microsoft/sdl/no-winjs-html-unsafe`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-winjs-html-unsafe.md +[`@microsoft/sdl/react-iframe-missing-sandbox`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/react-iframe-missing-sandbox.md + + + +[`prefer-arrow/prefer-arrow-functions`]: https://github.com/TristonJ/eslint-plugin-prefer-arrow +[plugin:promise]: https://github.com/xjamundx/eslint-plugin-promise +[plugin:header]: https://github.com/Stuk/eslint-plugin-header +[plugin:file-header]: https://github.com/Sekhmet/eslint-plugin-file-header +[plugin:compat]: https://github.com/amilajack/eslint-plugin-compat +[`no-null/no-null`]: https://github.com/nene/eslint-plugin-no-null +[`unicorn/filename-case`]: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/filename-case.md +[`jest/no-focused-tests`]: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-focused-tests.md +[`jsx-a11y/heading-has-content`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md +[`lodash/chaining`]: https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/chaining.md +[`deprecation/deprecation`]: https://github.com/gund/eslint-plugin-deprecation +[`desktop/insecure-random`]: https://github.com/desktop/desktop/blob/development/eslint-rules/insecure-random.js diff --git a/packages/eslint-plugin/src/configs/README.md b/packages/eslint-plugin/src/configs/README.md deleted file mode 100644 index c440d3d61c5..00000000000 --- a/packages/eslint-plugin/src/configs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Premade Configs - -This page has moved to [docs/linting/CONFIGS.md](../../../../docs/linting/CONFIGS.md). diff --git a/packages/parser/README.md b/packages/parser/README.md index 018935b2ca9..3488cd5e505 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -256,7 +256,7 @@ Note that if you pass custom programs via `options.programs` this option will no Default `undefined`. -This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/docs/linting/type-linting). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. +This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/docs/linting/typed-linting). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. ## Utilities diff --git a/packages/website/docusaurusConfig.ts b/packages/website/docusaurusConfig.ts index ac050430f53..db806b0a3aa 100644 --- a/packages/website/docusaurusConfig.ts +++ b/packages/website/docusaurusConfig.ts @@ -172,7 +172,7 @@ const config: Config = { url: 'https://typescript-eslint.io', baseUrl: '/', onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', // If Markdown link resolution fails, it will result in a broken link anyways + onBrokenMarkdownLinks: 'throw', favicon: 'img/favicon.ico', organizationName: 'typescript-eslint', projectName: 'typescript-eslint', diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index 8fbf27e2dc9..8e896c376ad 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -1,18 +1,34 @@ module.exports = { docs: [ - 'README', { - type: 'category', - label: 'Linting', collapsed: false, items: [ - 'linting/linting', - 'linting/type-linting', + { + label: 'Linting with Type Information', + items: ['linting/typed-linting/monorepos'], + link: { + id: 'linting/typed-linting', + type: 'doc', + }, + type: 'category', + }, 'linting/configs', - 'linting/monorepo', - 'linting/troubleshooting', - 'linting/tslint', + { + label: 'Troubleshooting & FAQs', + link: { + id: 'linting/troubleshooting', + type: 'doc', + }, + type: 'category', + items: ['linting/troubleshooting/tslint'], + }, ], + link: { + id: 'getting-started', + type: 'doc', + }, + label: 'Getting Started', + type: 'category', }, { type: 'category',