eslint 8.34.0 → 8.37.0
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.
- package/README.md +11 -12
- package/conf/rule-type-list.json +2 -2
- package/lib/cli-engine/cli-engine.js +2 -2
- package/lib/cli-engine/file-enumerator.js +8 -6
- package/lib/config/default-config.js +1 -4
- package/lib/config/flat-config-array.js +77 -17
- package/lib/config/flat-config-schema.js +4 -18
- package/lib/eslint/eslint-helpers.js +3 -3
- package/lib/linter/linter.js +5 -30
- package/lib/rule-tester/flat-rule-tester.js +1 -1
- package/lib/rule-tester/rule-tester.js +1 -1
- package/lib/rules/camelcase.js +3 -2
- package/lib/rules/consistent-this.js +4 -2
- package/lib/rules/global-require.js +3 -1
- package/lib/rules/handle-callback-err.js +2 -1
- package/lib/rules/id-blacklist.js +3 -2
- package/lib/rules/id-denylist.js +3 -2
- package/lib/rules/id-match.js +3 -2
- package/lib/rules/lines-around-comment.js +11 -0
- package/lib/rules/logical-assignment-operators.js +4 -4
- package/lib/rules/multiline-comment-style.js +42 -3
- package/lib/rules/no-alert.js +3 -1
- package/lib/rules/no-catch-shadow.js +3 -1
- package/lib/rules/no-console.js +3 -2
- package/lib/rules/no-constant-binary-expression.js +36 -27
- package/lib/rules/no-constant-condition.js +3 -2
- package/lib/rules/no-control-regex.js +1 -1
- package/lib/rules/no-else-return.js +13 -12
- package/lib/rules/no-eval.js +5 -5
- package/lib/rules/no-extend-native.js +3 -2
- package/lib/rules/no-extra-boolean-cast.js +1 -1
- package/lib/rules/no-extra-parens.js +1 -1
- package/lib/rules/no-global-assign.js +3 -2
- package/lib/rules/no-implicit-globals.js +3 -2
- package/lib/rules/no-implied-eval.js +5 -4
- package/lib/rules/no-import-assign.js +4 -2
- package/lib/rules/no-invalid-regexp.js +1 -1
- package/lib/rules/no-invalid-this.js +2 -2
- package/lib/rules/no-label-var.js +2 -1
- package/lib/rules/no-lone-blocks.js +3 -2
- package/lib/rules/no-loop-func.js +3 -1
- package/lib/rules/no-misleading-character-class.js +12 -41
- package/lib/rules/no-native-reassign.js +3 -2
- package/lib/rules/no-new-func.js +7 -6
- package/lib/rules/no-new-native-nonconstructor.js +8 -6
- package/lib/rules/no-new-object.js +4 -1
- package/lib/rules/no-new-symbol.js +8 -6
- package/lib/rules/no-obj-calls.js +8 -6
- package/lib/rules/no-promise-executor-return.js +3 -2
- package/lib/rules/no-redeclare.js +3 -3
- package/lib/rules/no-regex-spaces.js +4 -2
- package/lib/rules/no-restricted-globals.js +4 -2
- package/lib/rules/no-setter-return.js +3 -2
- package/lib/rules/no-shadow.js +3 -2
- package/lib/rules/no-undef-init.js +1 -1
- package/lib/rules/no-undef.js +3 -2
- package/lib/rules/no-undefined.js +4 -2
- package/lib/rules/no-unmodified-loop-condition.js +2 -2
- package/lib/rules/no-unused-vars.js +1 -1
- package/lib/rules/no-use-before-define.js +3 -2
- package/lib/rules/no-useless-backreference.js +9 -7
- package/lib/rules/no-useless-return.js +1 -1
- package/lib/rules/object-shorthand.js +3 -2
- package/lib/rules/prefer-arrow-callback.js +1 -1
- package/lib/rules/prefer-exponentiation-operator.js +5 -5
- package/lib/rules/prefer-named-capture-group.js +8 -8
- package/lib/rules/prefer-object-has-own.js +4 -2
- package/lib/rules/prefer-object-spread.js +12 -12
- package/lib/rules/prefer-regex-literals.js +26 -27
- package/lib/rules/prefer-rest-params.js +5 -2
- package/lib/rules/radix.js +11 -11
- package/lib/rules/require-atomic-updates.js +2 -2
- package/lib/rules/require-unicode-regexp.js +63 -7
- package/lib/rules/symbol-description.js +7 -5
- package/lib/rules/utils/regular-expressions.js +42 -0
- package/lib/rules/valid-typeof.js +3 -3
- package/lib/rules/wrap-iife.js +1 -1
- package/lib/source-code/source-code.js +52 -1
- package/lib/source-code/token-store/index.js +1 -1
- package/lib/source-code/token-store/utils.js +14 -4
- package/messages/no-config-found.js +1 -1
- package/package.json +12 -7
- package/conf/eslint-all.js +0 -31
- package/conf/eslint-recommended.js +0 -76
@@ -10,6 +10,6 @@ ESLint couldn't find a configuration file. To set up a configuration file for th
|
|
10
10
|
|
11
11
|
ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory.
|
12
12
|
|
13
|
-
If you think you already have a configuration file or if you need more help, please stop by the ESLint
|
13
|
+
If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat
|
14
14
|
`.trimStart();
|
15
15
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint",
|
3
|
-
"version": "8.
|
3
|
+
"version": "8.37.0",
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
6
6
|
"bin": {
|
@@ -37,6 +37,10 @@
|
|
37
37
|
"lint-staged": {
|
38
38
|
"*.js": "eslint --fix",
|
39
39
|
"*.md": "markdownlint --fix",
|
40
|
+
"lib/rules/*.js": [
|
41
|
+
"node tools/update-eslint-all.js",
|
42
|
+
"git add packages/js/src/configs/eslint-all.js"
|
43
|
+
],
|
40
44
|
"docs/src/rules/*.md": [
|
41
45
|
"node tools/fetch-docs-links.js",
|
42
46
|
"git add docs/src/_data/further_reading_links.json"
|
@@ -56,7 +60,10 @@
|
|
56
60
|
"homepage": "https://eslint.org",
|
57
61
|
"bugs": "https://github.com/eslint/eslint/issues/",
|
58
62
|
"dependencies": {
|
59
|
-
"@eslint/
|
63
|
+
"@eslint-community/eslint-utils": "^4.2.0",
|
64
|
+
"@eslint-community/regexpp": "^4.4.0",
|
65
|
+
"@eslint/eslintrc": "^2.0.2",
|
66
|
+
"@eslint/js": "8.37.0",
|
60
67
|
"@humanwhocodes/config-array": "^0.11.8",
|
61
68
|
"@humanwhocodes/module-importer": "^1.0.1",
|
62
69
|
"@nodelib/fs.walk": "^1.2.8",
|
@@ -67,10 +74,9 @@
|
|
67
74
|
"doctrine": "^3.0.0",
|
68
75
|
"escape-string-regexp": "^4.0.0",
|
69
76
|
"eslint-scope": "^7.1.1",
|
70
|
-
"eslint-
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"esquery": "^1.4.0",
|
77
|
+
"eslint-visitor-keys": "^3.4.0",
|
78
|
+
"espree": "^9.5.1",
|
79
|
+
"esquery": "^1.4.2",
|
74
80
|
"esutils": "^2.0.2",
|
75
81
|
"fast-deep-equal": "^3.1.3",
|
76
82
|
"file-entry-cache": "^6.0.1",
|
@@ -91,7 +97,6 @@
|
|
91
97
|
"minimatch": "^3.1.2",
|
92
98
|
"natural-compare": "^1.4.0",
|
93
99
|
"optionator": "^0.9.1",
|
94
|
-
"regexpp": "^3.2.0",
|
95
100
|
"strip-ansi": "^6.0.1",
|
96
101
|
"strip-json-comments": "^3.1.0",
|
97
102
|
"text-table": "^0.2.0"
|
package/conf/eslint-all.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @fileoverview Config to enable all rules.
|
3
|
-
* @author Robert Fletcher
|
4
|
-
*/
|
5
|
-
|
6
|
-
"use strict";
|
7
|
-
|
8
|
-
//------------------------------------------------------------------------------
|
9
|
-
// Requirements
|
10
|
-
//------------------------------------------------------------------------------
|
11
|
-
|
12
|
-
const builtInRules = require("../lib/rules");
|
13
|
-
|
14
|
-
//------------------------------------------------------------------------------
|
15
|
-
// Helpers
|
16
|
-
//------------------------------------------------------------------------------
|
17
|
-
|
18
|
-
const allRules = {};
|
19
|
-
|
20
|
-
for (const [ruleId, rule] of builtInRules) {
|
21
|
-
if (!rule.meta.deprecated) {
|
22
|
-
allRules[ruleId] = "error";
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
//------------------------------------------------------------------------------
|
27
|
-
// Public Interface
|
28
|
-
//------------------------------------------------------------------------------
|
29
|
-
|
30
|
-
/** @type {import("../lib/shared/types").ConfigData} */
|
31
|
-
module.exports = { rules: allRules };
|
@@ -1,76 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @fileoverview Configuration applied when a user configuration extends from
|
3
|
-
* eslint:recommended.
|
4
|
-
* @author Nicholas C. Zakas
|
5
|
-
*/
|
6
|
-
|
7
|
-
"use strict";
|
8
|
-
|
9
|
-
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
10
|
-
|
11
|
-
/** @type {import("../lib/shared/types").ConfigData} */
|
12
|
-
module.exports = {
|
13
|
-
rules: {
|
14
|
-
"constructor-super": "error",
|
15
|
-
"for-direction": "error",
|
16
|
-
"getter-return": "error",
|
17
|
-
"no-async-promise-executor": "error",
|
18
|
-
"no-case-declarations": "error",
|
19
|
-
"no-class-assign": "error",
|
20
|
-
"no-compare-neg-zero": "error",
|
21
|
-
"no-cond-assign": "error",
|
22
|
-
"no-const-assign": "error",
|
23
|
-
"no-constant-condition": "error",
|
24
|
-
"no-control-regex": "error",
|
25
|
-
"no-debugger": "error",
|
26
|
-
"no-delete-var": "error",
|
27
|
-
"no-dupe-args": "error",
|
28
|
-
"no-dupe-class-members": "error",
|
29
|
-
"no-dupe-else-if": "error",
|
30
|
-
"no-dupe-keys": "error",
|
31
|
-
"no-duplicate-case": "error",
|
32
|
-
"no-empty": "error",
|
33
|
-
"no-empty-character-class": "error",
|
34
|
-
"no-empty-pattern": "error",
|
35
|
-
"no-ex-assign": "error",
|
36
|
-
"no-extra-boolean-cast": "error",
|
37
|
-
"no-extra-semi": "error",
|
38
|
-
"no-fallthrough": "error",
|
39
|
-
"no-func-assign": "error",
|
40
|
-
"no-global-assign": "error",
|
41
|
-
"no-import-assign": "error",
|
42
|
-
"no-inner-declarations": "error",
|
43
|
-
"no-invalid-regexp": "error",
|
44
|
-
"no-irregular-whitespace": "error",
|
45
|
-
"no-loss-of-precision": "error",
|
46
|
-
"no-misleading-character-class": "error",
|
47
|
-
"no-mixed-spaces-and-tabs": "error",
|
48
|
-
"no-new-symbol": "error",
|
49
|
-
"no-nonoctal-decimal-escape": "error",
|
50
|
-
"no-obj-calls": "error",
|
51
|
-
"no-octal": "error",
|
52
|
-
"no-prototype-builtins": "error",
|
53
|
-
"no-redeclare": "error",
|
54
|
-
"no-regex-spaces": "error",
|
55
|
-
"no-self-assign": "error",
|
56
|
-
"no-setter-return": "error",
|
57
|
-
"no-shadow-restricted-names": "error",
|
58
|
-
"no-sparse-arrays": "error",
|
59
|
-
"no-this-before-super": "error",
|
60
|
-
"no-undef": "error",
|
61
|
-
"no-unexpected-multiline": "error",
|
62
|
-
"no-unreachable": "error",
|
63
|
-
"no-unsafe-finally": "error",
|
64
|
-
"no-unsafe-negation": "error",
|
65
|
-
"no-unsafe-optional-chaining": "error",
|
66
|
-
"no-unused-labels": "error",
|
67
|
-
"no-unused-vars": "error",
|
68
|
-
"no-useless-backreference": "error",
|
69
|
-
"no-useless-catch": "error",
|
70
|
-
"no-useless-escape": "error",
|
71
|
-
"no-with": "error",
|
72
|
-
"require-yield": "error",
|
73
|
-
"use-isnan": "error",
|
74
|
-
"valid-typeof": "error"
|
75
|
-
}
|
76
|
-
};
|