@typescript-eslint/eslint-plugin 8.24.1-alpha.4 → 8.24.1-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ const ts = __importStar(require("typescript"));
39
39
  const util_1 = require("../util");
40
40
  const FUNCTION_CONSTRUCTOR = 'Function';
41
41
  const GLOBAL_CANDIDATES = new Set(['global', 'globalThis', 'window']);
42
- const EVAL_LIKE_METHODS = new Set([
42
+ const EVAL_LIKE_FUNCTIONS = new Set([
43
43
  'execScript',
44
44
  'setImmediate',
45
45
  'setInterval',
@@ -50,7 +50,7 @@ exports.default = (0, util_1.createRule)({
50
50
  meta: {
51
51
  type: 'suggestion',
52
52
  docs: {
53
- description: 'Disallow the use of `eval()`-like methods',
53
+ description: 'Disallow the use of `eval()`-like functions',
54
54
  extendsBaseRule: true,
55
55
  recommended: 'recommended',
56
56
  requiresTypeChecking: true,
@@ -138,7 +138,7 @@ exports.default = (0, util_1.createRule)({
138
138
  return;
139
139
  }
140
140
  const [handler] = node.arguments;
141
- if (EVAL_LIKE_METHODS.has(calleeName) &&
141
+ if (EVAL_LIKE_FUNCTIONS.has(calleeName) &&
142
142
  !isFunction(handler) &&
143
143
  (0, util_1.isReferenceToGlobalFunction)(calleeName, node, context.sourceCode)) {
144
144
  context.report({ node: handler, messageId: 'noImpliedEvalError' });
@@ -1 +1 @@
1
- {"version":3,"file":"no-implied-eval.js","sourceRoot":"","sources":["../../src/rules/no-implied-eval.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,oDAA0D;AAC1D,sDAAwC;AACxC,+CAAiC;AAEjC,kCAKiB;AAEjB,MAAM,oBAAoB,GAAG,UAAU,CAAC;AACxC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtE,MAAM,iBAAiB,GAAG,IAA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CAAC,CAAC;gBACrD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBAChC,IAAI,MAAM,EAAE,CAAC;oBACX,IACE,IAAA,0BAAmB,EAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,qBAAqB,CAAC,EAClE,CAAC;wBACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAC;wBAC7D,OAAO;oBACT,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAC;oBAC7D,OAAO;gBACT,CAAC;YACH,CAAC;YAED,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAChC,OAAO;YACT,CAAC;YAED,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;YACjC,IACE,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAC;gBACnC,CAAC,UAAU,CAAC,OAAO,CAAC;gBACpB,IAAA,kCAA2B,EAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,EACjE,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,OAAO;YACL,cAAc,EAAE,gBAAgB;YAChC,aAAa,EAAE,gBAAgB;SAChC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/class-methods-use-this** for documentation.
11
11
 
12
- This rule extends the base [`eslint/class-methods-use-this`](https://eslint.org/docs/rules/class-methods-use-this) rule.
13
12
  It adds support for ignoring `override` methods and/or methods on classes that implement an interface.
14
13
 
15
14
  ## Options
@@ -9,8 +9,7 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/consistent-return** for documentation.
11
11
 
12
- This rule extends the base [`eslint/consistent-return`](https://eslint.org/docs/rules/consistent-return) rule.
13
- This version adds support for functions that return `void` or `Promise<void>`.
12
+ It adds support for functions that return `void` or `Promise<void>`.
14
13
 
15
14
  :::danger warning
16
15
  If possible, it is recommended to use tsconfig's `noImplicitReturns` option rather than this rule. `noImplicitReturns` is powered by TS's type information and control-flow analysis so it has better coverage than this rule.
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/default-param-last** for documentation.
11
11
 
12
- This rule extends the base [`eslint/default-param-last`](https://eslint.org/docs/rules/default-param-last) rule.
13
12
  It adds support for optional parameters.
14
13
 
15
14
  <Tabs>
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/dot-notation** for documentation.
11
11
 
12
- This rule extends the base [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation) rule.
13
12
  It adds:
14
13
 
15
14
  - Support for optionally ignoring computed `private` and/or `protected` member access.
@@ -9,5 +9,4 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/init-declarations** for documentation.
11
11
 
12
- This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule.
13
12
  It adds support for TypeScript's `declare` variables.
@@ -9,8 +9,7 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/max-params** for documentation.
11
11
 
12
- This rule extends the base [`eslint/max-params`](https://eslint.org/docs/rules/max-params) rule.
13
- This version adds support for TypeScript `this` parameters so they won't be counted as a parameter.
12
+ It adds support for TypeScript `this` parameters so they won't be counted as a parameter.
14
13
 
15
14
  ## Options
16
15
 
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-array-constructor** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) rule.
13
12
  It adds support for the generically typed `Array` constructor (`new Array<Foo>()`).
14
13
 
15
14
  <Tabs>
@@ -13,5 +13,4 @@ import TypeScriptOverlap from '@site/src/components/TypeScriptOverlap';
13
13
 
14
14
  <TypeScriptOverlap />
15
15
 
16
- This rule extends the base [`eslint/no-dupe-class-members`](https://eslint.org/docs/rules/no-dupe-class-members) rule.
17
16
  It adds support for TypeScript's method overload definitions.
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-empty-function** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-empty-function`](https://eslint.org/docs/rules/no-empty-function) rule.
13
12
  It adds support for handling TypeScript specific code that would otherwise trigger the rule.
14
13
 
15
14
  One example of valid TypeScript specific code that would otherwise trigger the `no-empty-function` rule is the use of [parameter properties](https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties) in constructor functions.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 'Disallow the use of `eval()`-like methods.'
2
+ description: 'Disallow the use of `eval()`-like functions.'
3
3
  ---
4
4
 
5
5
  import Tabs from '@theme/Tabs';
@@ -9,6 +9,8 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-implied-eval** for documentation.
11
11
 
12
+ It uses type information to determine which values are `eval()`-like functions.
13
+
12
14
  It's considered a good practice to avoid using `eval()`. There are security and performance implications involved with doing so, which is why many linters recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.
13
15
 
14
16
  The first is using `setTimeout()`, `setInterval()`, `setImmediate` or `execScript()` (Internet Explorer only), all of which can accept a string of code as their first argument
@@ -13,5 +13,4 @@ import TypeScriptOverlap from '@site/src/components/TypeScriptOverlap';
13
13
 
14
14
  <TypeScriptOverlap strict />
15
15
 
16
- This rule extends the base [`eslint/no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this) rule.
17
16
  It adds support for TypeScript's `this` parameters.
@@ -9,5 +9,4 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-loop-func** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule.
13
12
  It adds support for TypeScript types.
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-magic-numbers** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-magic-numbers`](https://eslint.org/docs/rules/no-magic-numbers) rule.
13
12
  It adds support for:
14
13
 
15
14
  - numeric literal types (`type T = 1`),
@@ -13,7 +13,6 @@ import TypeScriptOverlap from '@site/src/components/TypeScriptOverlap';
13
13
 
14
14
  <TypeScriptOverlap />
15
15
 
16
- This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule.
17
16
  It adds support for TypeScript function overloads, and declaration merging.
18
17
 
19
18
  ## Options
@@ -9,7 +9,11 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-restricted-imports** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-restricted-imports`](https://eslint.org/docs/rules/no-restricted-imports) rule. It adds support for the type import (`import type X from "..."`, `import { type X } from "..."`) and `import x = require("...")` syntaxes.
12
+ It adds support for type import syntaxes:
13
+
14
+ - `import type X from "..."`
15
+ - `import { type X } from "..."`
16
+ - `import x = require("...")`
13
17
 
14
18
  ## Options
15
19
 
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-shadow** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule.
13
12
  It adds support for TypeScript's `this` parameters and global augmentation, and adds options for TypeScript features.
14
13
 
15
14
  ## Options
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-unused-expressions** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions) rule.
13
12
  It supports TypeScript-specific expressions:
14
13
 
15
14
  - Marks directives in modules declarations (`"use strict"`, etc.) as not unused
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-unused-vars** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-unused-vars`](https://eslint.org/docs/rules/no-unused-vars) rule.
13
12
  It adds support for TypeScript features, such as types.
14
13
 
15
14
  ## Options
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-use-before-define** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-use-before-define`](https://eslint.org/docs/rules/no-use-before-define) rule.
13
12
  It adds support for `type`, `interface` and `enum` declarations.
14
13
 
15
14
  ## Options
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-useless-constructor** for documentation.
11
11
 
12
- This rule extends the base [`eslint/no-useless-constructor`](https://eslint.org/docs/rules/no-useless-constructor) rule.
13
12
  It adds support for:
14
13
 
15
14
  - constructors marked as `protected` / `private` (i.e. marking a constructor as non-public),
@@ -9,14 +9,14 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/only-throw-error** for documentation.
11
11
 
12
+ It uses type information to determine which values are `Error`s.
13
+
12
14
  It is considered good practice to only `throw` the `Error` object itself or an object using the `Error` object as base objects for user-defined exceptions.
13
15
  The fundamental benefit of `Error` objects is that they automatically keep track of where they were built and originated.
14
16
 
15
- This rule restricts what can be thrown as an exception.
16
-
17
17
  :::info[Migration from `no-throw-literal`]
18
18
 
19
- This rule was formerly known as `no-throw-literal`.
19
+ This extension rule was formerly known as `@typescript-eslint/no-throw-literal`.
20
20
  The new name is a drop-in replacement with identical functionality.
21
21
 
22
22
  :::
@@ -9,11 +9,10 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/prefer-destructuring** for documentation.
11
11
 
12
- ## Examples
13
-
14
- This rule extends the base [`eslint/prefer-destructuring`](https://eslint.org/docs/latest/rules/prefer-destructuring) rule.
15
12
  It adds support for TypeScript's type annotations in variable declarations.
16
13
 
14
+ ## Examples
15
+
17
16
  <Tabs>
18
17
 
19
18
  <TabItem value="`eslint/prefer-destructuring`">
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/prefer-promise-reject-errors** for documentation.
11
11
 
12
- This rule extends the base [`eslint/prefer-promise-reject-errors`](https://eslint.org/docs/rules/prefer-promise-reject-errors) rule.
13
12
  It uses type information to enforce that `Promise`s are only rejected with `Error` objects.
14
13
 
15
14
  ## Examples
@@ -9,7 +9,6 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/require-await** for documentation.
11
11
 
12
- This rule extends the base [`eslint/require-await`](https://eslint.org/docs/rules/require-await) rule.
13
12
  It uses type information to allow promise-returning functions to be marked as `async` without containing an `await` expression.
14
13
 
15
14
  :::note
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "8.24.1-alpha.4",
3
+ "version": "8.24.1-alpha.5",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -61,10 +61,10 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@eslint-community/regexpp": "^4.10.0",
64
- "@typescript-eslint/scope-manager": "8.24.1-alpha.4",
65
- "@typescript-eslint/type-utils": "8.24.1-alpha.4",
66
- "@typescript-eslint/utils": "8.24.1-alpha.4",
67
- "@typescript-eslint/visitor-keys": "8.24.1-alpha.4",
64
+ "@typescript-eslint/scope-manager": "8.24.1-alpha.5",
65
+ "@typescript-eslint/type-utils": "8.24.1-alpha.5",
66
+ "@typescript-eslint/utils": "8.24.1-alpha.5",
67
+ "@typescript-eslint/visitor-keys": "8.24.1-alpha.5",
68
68
  "graphemer": "^1.4.0",
69
69
  "ignore": "^5.3.1",
70
70
  "natural-compare": "^1.4.0",
@@ -75,8 +75,8 @@
75
75
  "@types/marked": "^5.0.2",
76
76
  "@types/mdast": "^4.0.3",
77
77
  "@types/natural-compare": "*",
78
- "@typescript-eslint/rule-schema-to-typescript-types": "8.24.1-alpha.4",
79
- "@typescript-eslint/rule-tester": "8.24.1-alpha.4",
78
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.24.1-alpha.5",
79
+ "@typescript-eslint/rule-tester": "8.24.1-alpha.5",
80
80
  "ajv": "^6.12.6",
81
81
  "cross-env": "^7.0.3",
82
82
  "cross-fetch": "*",