eslint 8.34.0 → 8.39.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.
Files changed (104) hide show
  1. package/README.md +7 -18
  2. package/conf/rule-type-list.json +2 -2
  3. package/lib/cli-engine/cli-engine.js +2 -2
  4. package/lib/cli-engine/file-enumerator.js +8 -6
  5. package/lib/config/default-config.js +1 -4
  6. package/lib/config/flat-config-array.js +77 -17
  7. package/lib/config/flat-config-schema.js +4 -18
  8. package/lib/eslint/eslint-helpers.js +3 -3
  9. package/lib/linter/linter.js +4 -77
  10. package/lib/rule-tester/flat-rule-tester.js +1 -1
  11. package/lib/rule-tester/rule-tester.js +1 -1
  12. package/lib/rules/block-scoped-var.js +2 -1
  13. package/lib/rules/camelcase.js +5 -4
  14. package/lib/rules/consistent-this.js +4 -2
  15. package/lib/rules/func-names.js +1 -1
  16. package/lib/rules/global-require.js +4 -2
  17. package/lib/rules/handle-callback-err.js +2 -1
  18. package/lib/rules/id-blacklist.js +3 -2
  19. package/lib/rules/id-denylist.js +3 -2
  20. package/lib/rules/id-match.js +3 -2
  21. package/lib/rules/lines-around-comment.js +11 -0
  22. package/lib/rules/logical-assignment-operators.js +4 -4
  23. package/lib/rules/multiline-comment-style.js +42 -3
  24. package/lib/rules/new-parens.js +5 -14
  25. package/lib/rules/no-alert.js +3 -1
  26. package/lib/rules/no-catch-shadow.js +3 -1
  27. package/lib/rules/no-class-assign.js +3 -1
  28. package/lib/rules/no-console.js +3 -2
  29. package/lib/rules/no-const-assign.js +3 -1
  30. package/lib/rules/no-constant-binary-expression.js +36 -27
  31. package/lib/rules/no-constant-condition.js +3 -2
  32. package/lib/rules/no-control-regex.js +1 -1
  33. package/lib/rules/no-div-regex.js +1 -1
  34. package/lib/rules/no-dupe-args.js +3 -1
  35. package/lib/rules/no-else-return.js +13 -12
  36. package/lib/rules/no-eval.js +5 -5
  37. package/lib/rules/no-ex-assign.js +3 -1
  38. package/lib/rules/no-extend-native.js +3 -2
  39. package/lib/rules/no-extra-boolean-cast.js +1 -1
  40. package/lib/rules/no-extra-parens.js +1 -1
  41. package/lib/rules/no-func-assign.js +3 -1
  42. package/lib/rules/no-global-assign.js +3 -2
  43. package/lib/rules/no-implicit-globals.js +3 -2
  44. package/lib/rules/no-implied-eval.js +5 -4
  45. package/lib/rules/no-import-assign.js +5 -3
  46. package/lib/rules/no-invalid-regexp.js +1 -1
  47. package/lib/rules/no-invalid-this.js +2 -2
  48. package/lib/rules/no-label-var.js +2 -1
  49. package/lib/rules/no-lone-blocks.js +8 -6
  50. package/lib/rules/no-lonely-if.js +2 -3
  51. package/lib/rules/no-loop-func.js +3 -1
  52. package/lib/rules/no-misleading-character-class.js +12 -41
  53. package/lib/rules/no-native-reassign.js +3 -2
  54. package/lib/rules/no-new-func.js +7 -6
  55. package/lib/rules/no-new-native-nonconstructor.js +8 -6
  56. package/lib/rules/no-new-object.js +4 -1
  57. package/lib/rules/no-new-symbol.js +8 -6
  58. package/lib/rules/no-obj-calls.js +8 -6
  59. package/lib/rules/no-param-reassign.js +2 -1
  60. package/lib/rules/no-promise-executor-return.js +3 -2
  61. package/lib/rules/no-redeclare.js +3 -3
  62. package/lib/rules/no-regex-spaces.js +4 -2
  63. package/lib/rules/no-restricted-exports.js +2 -1
  64. package/lib/rules/no-restricted-globals.js +4 -2
  65. package/lib/rules/no-setter-return.js +3 -2
  66. package/lib/rules/no-shadow-restricted-names.js +2 -1
  67. package/lib/rules/no-shadow.js +3 -2
  68. package/lib/rules/no-undef-init.js +1 -1
  69. package/lib/rules/no-undef.js +3 -2
  70. package/lib/rules/no-undefined.js +4 -2
  71. package/lib/rules/no-underscore-dangle.js +2 -1
  72. package/lib/rules/no-unmodified-loop-condition.js +2 -2
  73. package/lib/rules/no-unused-expressions.js +4 -5
  74. package/lib/rules/no-unused-vars.js +2 -2
  75. package/lib/rules/no-use-before-define.js +3 -2
  76. package/lib/rules/no-useless-backreference.js +9 -7
  77. package/lib/rules/no-useless-return.js +1 -1
  78. package/lib/rules/no-var.js +2 -2
  79. package/lib/rules/object-shorthand.js +3 -2
  80. package/lib/rules/prefer-arrow-callback.js +2 -2
  81. package/lib/rules/prefer-const.js +1 -1
  82. package/lib/rules/prefer-exponentiation-operator.js +5 -5
  83. package/lib/rules/prefer-named-capture-group.js +8 -8
  84. package/lib/rules/prefer-object-has-own.js +4 -2
  85. package/lib/rules/prefer-object-spread.js +12 -13
  86. package/lib/rules/prefer-promise-reject-errors.js +2 -1
  87. package/lib/rules/prefer-regex-literals.js +26 -27
  88. package/lib/rules/prefer-rest-params.js +5 -2
  89. package/lib/rules/radix.js +11 -11
  90. package/lib/rules/require-atomic-updates.js +2 -2
  91. package/lib/rules/require-unicode-regexp.js +67 -7
  92. package/lib/rules/symbol-description.js +7 -5
  93. package/lib/rules/utils/regular-expressions.js +42 -0
  94. package/lib/rules/valid-typeof.js +4 -4
  95. package/lib/rules/wrap-iife.js +1 -1
  96. package/lib/rules/wrap-regex.js +2 -3
  97. package/lib/rules/yoda.js +1 -1
  98. package/lib/source-code/source-code.js +137 -1
  99. package/lib/source-code/token-store/index.js +1 -1
  100. package/lib/source-code/token-store/utils.js +35 -20
  101. package/messages/no-config-found.js +1 -1
  102. package/package.json +13 -8
  103. package/conf/eslint-all.js +0 -31
  104. package/conf/eslint-recommended.js +0 -76
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "8.34.0",
3
+ "version": "8.39.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/eslintrc": "^1.4.1",
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.39.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",
@@ -66,11 +73,10 @@
66
73
  "debug": "^4.3.2",
67
74
  "doctrine": "^3.0.0",
68
75
  "escape-string-regexp": "^4.0.0",
69
- "eslint-scope": "^7.1.1",
70
- "eslint-utils": "^3.0.0",
71
- "eslint-visitor-keys": "^3.3.0",
72
- "espree": "^9.4.0",
73
- "esquery": "^1.4.0",
76
+ "eslint-scope": "^7.2.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"
@@ -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
- };