Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d0af64

Browse files
docs(eslint-plugin): Move no-implied-eval & no-throw-literal to Extension Rules (typescript-eslint#2745)
1 parent e82698c commit 0d0af64

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

packages/eslint-plugin/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int
126126
| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like values to be handled appropriately | :heavy_check_mark: | | :thought_balloon: |
127127
| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :heavy_check_mark: | | :thought_balloon: |
128128
| [`@typescript-eslint/no-implicit-any-catch`](./docs/rules/no-implicit-any-catch.md) | Disallow usage of the implicit `any` type in catch clauses | | :wrench: | |
129-
| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :heavy_check_mark: | | :thought_balloon: |
130129
| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :heavy_check_mark: | :wrench: | |
131130
| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | | | |
132131
| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :heavy_check_mark: | | |
@@ -137,7 +136,6 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int
137136
| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | |
138137
| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | |
139138
| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :heavy_check_mark: | | |
140-
| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | | | :thought_balloon: |
141139
| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | |
142140
| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | | :wrench: | :thought_balloon: |
143141
| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | | :wrench: | :thought_balloon: |
@@ -206,12 +204,14 @@ In these cases, we create what we call an extension rule; a rule within our plug
206204
| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | |
207205
| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | |
208206
| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :heavy_check_mark: | :wrench: | |
209-
| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | disallow `this` keywords outside of classes or class-like objects | | | |
207+
| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :heavy_check_mark: | | :thought_balloon: |
208+
| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | |
210209
| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | |
211210
| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | | | |
212211
| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | |
213212
| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | |
214213
| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | |
214+
| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | | | :thought_balloon: |
215215
| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | |
216216
| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | |
217217
| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | |

packages/eslint-plugin/docs/rules/no-invalid-this.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# disallow `this` keywords outside of classes or class-like objects (`no-invalid-this`)
1+
# Disallow `this` keywords outside of classes or class-like objects (`no-invalid-this`)
22

33
## Rule Details
44

packages/eslint-plugin/src/configs/all.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export = {
6666
'@typescript-eslint/no-floating-promises': 'error',
6767
'@typescript-eslint/no-for-in-array': 'error',
6868
'@typescript-eslint/no-implicit-any-catch': 'error',
69+
'no-implied-eval': 'off',
6970
'@typescript-eslint/no-implied-eval': 'error',
7071
'@typescript-eslint/no-inferrable-types': 'error',
7172
'no-invalid-this': 'off',
@@ -89,14 +90,15 @@ export = {
8990
'no-shadow': 'off',
9091
'@typescript-eslint/no-shadow': 'error',
9192
'@typescript-eslint/no-this-alias': 'error',
93+
'no-throw-literal': 'off',
9294
'@typescript-eslint/no-throw-literal': 'error',
9395
'@typescript-eslint/no-type-alias': 'error',
9496
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
9597
'@typescript-eslint/no-unnecessary-condition': 'error',
96-
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
9798
'@typescript-eslint/no-unnecessary-qualifier': 'error',
9899
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
99100
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
101+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
100102
'@typescript-eslint/no-unsafe-assignment': 'error',
101103
'@typescript-eslint/no-unsafe-call': 'error',
102104
'@typescript-eslint/no-unsafe-member-access': 'error',

packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export = {
88
'@typescript-eslint/await-thenable': 'error',
99
'@typescript-eslint/no-floating-promises': 'error',
1010
'@typescript-eslint/no-for-in-array': 'error',
11+
'no-implied-eval': 'off',
1112
'@typescript-eslint/no-implied-eval': 'error',
1213
'@typescript-eslint/no-misused-promises': 'error',
1314
'@typescript-eslint/no-unnecessary-type-assertion': 'error',

packages/eslint-plugin/src/rules/no-implied-eval.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default util.createRule({
2222
description: 'Disallow the use of `eval()`-like methods',
2323
category: 'Best Practices',
2424
recommended: 'error',
25+
extendsBaseRule: true,
2526
requiresTypeChecking: true,
2627
},
2728
messages: {

packages/eslint-plugin/src/rules/no-invalid-this.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default createRule<Options, MessageIds>({
1818
type: 'suggestion',
1919
docs: {
2020
description:
21-
'disallow `this` keywords outside of classes or class-like objects',
21+
'Disallow `this` keywords outside of classes or class-like objects',
2222
category: 'Best Practices',
2323
recommended: false,
2424
extendsBaseRule: true,

packages/eslint-plugin/src/rules/no-throw-literal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default util.createRule({
1313
description: 'Disallow throwing literals as exceptions',
1414
category: 'Best Practices',
1515
recommended: false,
16+
extendsBaseRule: true,
1617
requiresTypeChecking: true,
1718
},
1819
schema: [],

0 commit comments

Comments
 (0)