From ff0efbaf53eaa8a5b4083e441390555620bd6768 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 15 Feb 2020 18:11:20 -0500 Subject: [PATCH 1/2] docs(eslint-plugin): added missing TSLint 5.20 rules to ROADMAP.md We can be sure this is the last of the core rules to be added, because TSLint is deprecated now :smile:. --- packages/eslint-plugin/ROADMAP.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index c4f99f947af4..84d577184206 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -18,6 +18,7 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th | [`adjacent-overload-signatures`] | βœ… | [`@typescript-eslint/adjacent-overload-signatures`] | | [`ban-ts-ignore`] | βœ… | [`@typescript-eslint/ban-ts-ignore`] | | [`ban-types`] | πŸŒ“ | [`@typescript-eslint/ban-types`][1] | +| [`invalid-void`] | πŸ›‘ | N/A | | [`member-access`] | βœ… | [`@typescript-eslint/explicit-member-accessibility`] | | [`member-ordering`] | βœ… | [`@typescript-eslint/member-ordering`] | | [`no-any`] | βœ… | [`@typescript-eslint/no-explicit-any`] | @@ -74,7 +75,10 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th | [`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`] | πŸ›‘ | N/A | +| [`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] | @@ -82,6 +86,7 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th | [`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`] | @@ -96,7 +101,9 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th | [`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`] | πŸ›‘ | N/A | | [`strict-type-predicates`] | πŸ›‘ | N/A | | [`switch-default`] | 🌟 | [`default-case`][default-case] | | [`triple-equals`] | 🌟 | [`eqeqeq`][eqeqeq] | @@ -167,6 +174,7 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th | [`no-reference-import`] | πŸ›‘ | N/A | | [`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][2] | +| [`variable-name`] | 🌟 | [3] | | [`whitespace`] | πŸ”Œ | Use [Prettier] | [1] Recommended config: `["error", { blankLine: "always", prev: "*", next: "return" }]`
-[2] [`camelcase`][camelcase], [`no-underscore-dangle`][no-underscore-dangle], [`id-blacklist`][id-blacklist], and/or [`id-match`][id-match] +[2] Doesn't check other control flow statements, such as `break` or `continue`. +[3] [`camelcase`][camelcase], [`no-underscore-dangle`][no-underscore-dangle], [`id-blacklist`][id-blacklist], and/or [`id-match`][id-match] ## tslint-microsoft-contrib rules @@ -486,6 +495,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [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 @@ -541,6 +551,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [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 From 75f1539d609ac879d8794ee13996967bbadba66d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 22 Feb 2020 17:42:03 -0500 Subject: [PATCH 2/2] PR feedback updates --- packages/eslint-plugin/ROADMAP.md | 141 +++++++++++++++--------------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 84d577184206..61e4e350a5d8 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -44,73 +44,73 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th ### Functionality -| TSLint rule | | ESLint rule | -| ------------------------------------ | :-: | --------------------------------------------------------------------- | -| [`await-promise`] | βœ… | [`@typescript-eslint/await-thenable`] | -| [`ban-comma-operator`] | 🌟 | [`no-sequences`][no-sequences] | -| [`ban`] | 🌟 | [`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`] | πŸ›‘ | N/A | -| [`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`] | πŸ›‘ | N/A | -| [`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`] | 🌟 | [`no-void`][no-void] | -| [`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`] | πŸ›‘ | N/A | -| [`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] | +| TSLint rule | | ESLint rule | +| ------------------------------------ | :-: | ---------------------------------------------------------------------------------------------------- | +| [`await-promise`] | βœ… | [`@typescript-eslint/await-thenable`] | +| [`ban-comma-operator`] | 🌟 | [`no-sequences`][no-sequences] | +| [`ban`] | 🌟 | [`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`] | πŸ›‘ | N/A | +| [`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`] | 🌟 | [`no-void`][no-void] | +| [`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)) {}`)
@@ -171,7 +171,7 @@ It lists all TSLint rules along side rules from the ESLint ecosystem that are th | [`no-irregular-whitespace`] | 🌟 | [`no-irregular-whitespace`][no-irregular-whitespace] with `skipStrings: false` | | [`no-parameter-properties`] | βœ… | [`@typescript-eslint/no-parameter-properties`] | | [`no-redundant-jsdoc`] | πŸ”Œ | [`jsdoc/no-types`] | -| [`no-reference-import`] | πŸ›‘ | N/A | +| [`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][3] | +| [`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`. -[3] [`camelcase`][camelcase], [`no-underscore-dangle`][no-underscore-dangle], [`id-blacklist`][id-blacklist], and/or [`id-match`][id-match] ## tslint-microsoft-contrib rules @@ -602,6 +601,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/no-inferrable-types`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-inferrable-types.md [`@typescript-eslint/prefer-namespace-keyword`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md [`@typescript-eslint/promise-function-async`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md +[`@typescript-eslint/no-misused-promises`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-promises.md [`@typescript-eslint/no-namespace`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-namespace.md [`@typescript-eslint/no-non-null-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md [`@typescript-eslint/triple-slash-reference`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -625,6 +625,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/array-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md [`@typescript-eslint/class-name-casing`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/class-name-casing.md [`@typescript-eslint/interface-name-prefix`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/interface-name-prefix.md +[`@typescript-eslint/naming-convention`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md [`@typescript-eslint/no-parameter-properties`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-parameter-properties.md [`@typescript-eslint/member-delimiter-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md [`@typescript-eslint/prefer-for-of`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md