eslint 9.28.0 → 9.30.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 (107) hide show
  1. package/README.md +1 -1
  2. package/conf/ecma-version.js +1 -1
  3. package/conf/globals.js +10 -0
  4. package/lib/cli.js +6 -11
  5. package/lib/config/config-loader.js +2 -29
  6. package/lib/config/flat-config-array.js +1 -1
  7. package/lib/eslint/eslint.js +14 -18
  8. package/lib/languages/js/source-code/source-code.js +81 -27
  9. package/lib/linter/apply-disable-directives.js +2 -4
  10. package/lib/linter/code-path-analysis/code-path-analyzer.js +8 -9
  11. package/lib/linter/linter.js +4 -4
  12. package/lib/linter/source-code-traverser.js +64 -49
  13. package/lib/linter/source-code-visitor.js +81 -0
  14. package/lib/rules/array-bracket-newline.js +3 -3
  15. package/lib/rules/array-bracket-spacing.js +3 -3
  16. package/lib/rules/array-element-newline.js +3 -3
  17. package/lib/rules/arrow-parens.js +3 -3
  18. package/lib/rules/arrow-spacing.js +3 -3
  19. package/lib/rules/block-spacing.js +3 -3
  20. package/lib/rules/brace-style.js +3 -3
  21. package/lib/rules/class-methods-use-this.js +7 -0
  22. package/lib/rules/comma-dangle.js +3 -3
  23. package/lib/rules/comma-spacing.js +3 -3
  24. package/lib/rules/comma-style.js +3 -3
  25. package/lib/rules/computed-property-spacing.js +3 -3
  26. package/lib/rules/dot-location.js +3 -3
  27. package/lib/rules/eol-last.js +3 -3
  28. package/lib/rules/func-call-spacing.js +3 -3
  29. package/lib/rules/function-call-argument-newline.js +3 -3
  30. package/lib/rules/function-paren-newline.js +3 -3
  31. package/lib/rules/generator-star-spacing.js +3 -3
  32. package/lib/rules/implicit-arrow-linebreak.js +3 -3
  33. package/lib/rules/indent-legacy.js +3 -3
  34. package/lib/rules/indent.js +3 -3
  35. package/lib/rules/jsx-quotes.js +3 -3
  36. package/lib/rules/key-spacing.js +3 -3
  37. package/lib/rules/keyword-spacing.js +3 -3
  38. package/lib/rules/line-comment-position.js +3 -3
  39. package/lib/rules/linebreak-style.js +3 -3
  40. package/lib/rules/lines-around-comment.js +3 -3
  41. package/lib/rules/lines-around-directive.js +3 -3
  42. package/lib/rules/lines-between-class-members.js +3 -3
  43. package/lib/rules/max-len.js +3 -3
  44. package/lib/rules/max-statements-per-line.js +3 -3
  45. package/lib/rules/multiline-comment-style.js +3 -3
  46. package/lib/rules/multiline-ternary.js +3 -3
  47. package/lib/rules/new-parens.js +3 -3
  48. package/lib/rules/newline-after-var.js +3 -3
  49. package/lib/rules/newline-before-return.js +3 -3
  50. package/lib/rules/newline-per-chained-call.js +3 -3
  51. package/lib/rules/no-confusing-arrow.js +3 -3
  52. package/lib/rules/no-duplicate-imports.js +65 -7
  53. package/lib/rules/no-extra-parens.js +3 -3
  54. package/lib/rules/no-extra-semi.js +3 -3
  55. package/lib/rules/no-floating-decimal.js +3 -3
  56. package/lib/rules/no-mixed-operators.js +3 -3
  57. package/lib/rules/no-mixed-spaces-and-tabs.js +3 -3
  58. package/lib/rules/no-multi-spaces.js +3 -3
  59. package/lib/rules/no-multiple-empty-lines.js +3 -3
  60. package/lib/rules/no-promise-executor-return.js +4 -35
  61. package/lib/rules/no-restricted-globals.js +35 -2
  62. package/lib/rules/no-restricted-properties.js +35 -12
  63. package/lib/rules/no-setter-return.js +13 -48
  64. package/lib/rules/no-spaced-func.js +3 -3
  65. package/lib/rules/no-tabs.js +3 -3
  66. package/lib/rules/no-trailing-spaces.js +3 -3
  67. package/lib/rules/no-unused-vars.js +1 -1
  68. package/lib/rules/no-use-before-define.js +2 -0
  69. package/lib/rules/no-var.js +14 -2
  70. package/lib/rules/no-whitespace-before-property.js +3 -3
  71. package/lib/rules/nonblock-statement-body-position.js +3 -3
  72. package/lib/rules/object-curly-newline.js +3 -3
  73. package/lib/rules/object-curly-spacing.js +3 -3
  74. package/lib/rules/object-property-newline.js +3 -3
  75. package/lib/rules/one-var-declaration-per-line.js +3 -3
  76. package/lib/rules/operator-linebreak.js +3 -3
  77. package/lib/rules/padded-blocks.js +3 -3
  78. package/lib/rules/padding-line-between-statements.js +3 -3
  79. package/lib/rules/prefer-regex-literals.js +1 -18
  80. package/lib/rules/quote-props.js +3 -3
  81. package/lib/rules/quotes.js +3 -3
  82. package/lib/rules/rest-spread-spacing.js +3 -3
  83. package/lib/rules/semi-spacing.js +3 -3
  84. package/lib/rules/semi-style.js +3 -3
  85. package/lib/rules/semi.js +3 -3
  86. package/lib/rules/space-before-blocks.js +3 -3
  87. package/lib/rules/space-before-function-paren.js +3 -3
  88. package/lib/rules/space-in-parens.js +3 -3
  89. package/lib/rules/space-infix-ops.js +3 -3
  90. package/lib/rules/space-unary-ops.js +3 -3
  91. package/lib/rules/spaced-comment.js +3 -3
  92. package/lib/rules/switch-colon-spacing.js +3 -3
  93. package/lib/rules/template-curly-spacing.js +3 -3
  94. package/lib/rules/template-tag-spacing.js +3 -3
  95. package/lib/rules/utils/ast-utils.js +45 -0
  96. package/lib/rules/wrap-iife.js +3 -3
  97. package/lib/rules/wrap-regex.js +3 -3
  98. package/lib/rules/yield-star-spacing.js +3 -3
  99. package/lib/services/suppressions-service.js +8 -0
  100. package/lib/shared/flags.js +9 -1
  101. package/lib/shared/naming.js +109 -0
  102. package/lib/shared/relative-module-resolver.js +28 -0
  103. package/lib/shared/runtime-info.js +1 -1
  104. package/lib/types/index.d.ts +15 -2
  105. package/lib/types/rules.d.ts +83 -74
  106. package/package.json +8 -8
  107. package/lib/linter/safe-emitter.js +0 -52
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "9.28.0",
3
+ "version": "9.30.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "type": "commonjs",
@@ -106,11 +106,11 @@
106
106
  "dependencies": {
107
107
  "@eslint-community/eslint-utils": "^4.2.0",
108
108
  "@eslint-community/regexpp": "^4.12.1",
109
- "@eslint/config-array": "^0.20.0",
110
- "@eslint/config-helpers": "^0.2.1",
109
+ "@eslint/config-array": "^0.21.0",
110
+ "@eslint/config-helpers": "^0.3.0",
111
111
  "@eslint/core": "^0.14.0",
112
112
  "@eslint/eslintrc": "^3.3.1",
113
- "@eslint/js": "9.28.0",
113
+ "@eslint/js": "9.30.0",
114
114
  "@eslint/plugin-kit": "^0.3.1",
115
115
  "@humanfs/node": "^0.16.6",
116
116
  "@humanwhocodes/module-importer": "^1.0.1",
@@ -122,9 +122,9 @@
122
122
  "cross-spawn": "^7.0.6",
123
123
  "debug": "^4.3.2",
124
124
  "escape-string-regexp": "^4.0.0",
125
- "eslint-scope": "^8.3.0",
126
- "eslint-visitor-keys": "^4.2.0",
127
- "espree": "^10.3.0",
125
+ "eslint-scope": "^8.4.0",
126
+ "eslint-visitor-keys": "^4.2.1",
127
+ "espree": "^10.4.0",
128
128
  "esquery": "^1.5.0",
129
129
  "esutils": "^2.0.2",
130
130
  "fast-deep-equal": "^3.1.3",
@@ -176,7 +176,7 @@
176
176
  "jiti": "^2.2.0",
177
177
  "jiti-v2.0": "npm:jiti@2.0.x",
178
178
  "jiti-v2.1": "npm:jiti@2.1.x",
179
- "knip": "^5.32.0",
179
+ "knip": "^5.60.2",
180
180
  "lint-staged": "^11.0.0",
181
181
  "load-perf": "^0.2.0",
182
182
  "markdown-it": "^12.2.0",
@@ -1,52 +0,0 @@
1
- /**
2
- * @fileoverview A variant of EventEmitter which does not give listeners information about each other
3
- * @author Teddy Katz
4
- */
5
-
6
- "use strict";
7
-
8
- //------------------------------------------------------------------------------
9
- // Typedefs
10
- //------------------------------------------------------------------------------
11
-
12
- /**
13
- * An event emitter
14
- * @typedef {Object} SafeEmitter
15
- * @property {(eventName: string, listenerFunc: Function) => void} on Adds a listener for a given event name
16
- * @property {(eventName: string, arg1?: any, arg2?: any, arg3?: any) => void} emit Emits an event with a given name.
17
- * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments.
18
- * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners.
19
- */
20
-
21
- /**
22
- * Creates an object which can listen for and emit events.
23
- * This is similar to the EventEmitter API in Node's standard library, but it has a few differences.
24
- * The goal is to allow multiple modules to attach arbitrary listeners to the same emitter, without
25
- * letting the modules know about each other at all.
26
- * 1. It has no special keys like `error` and `newListener`, which would allow modules to detect when
27
- * another module throws an error or registers a listener.
28
- * 2. It calls listener functions without any `this` value. (`EventEmitter` calls listeners with a
29
- * `this` value of the emitter instance, which would give listeners access to other listeners.)
30
- * @returns {SafeEmitter} An emitter
31
- */
32
- module.exports = () => {
33
- const listeners = Object.create(null);
34
-
35
- return Object.freeze({
36
- on(eventName, listener) {
37
- if (eventName in listeners) {
38
- listeners[eventName].push(listener);
39
- } else {
40
- listeners[eventName] = [listener];
41
- }
42
- },
43
- emit(eventName, ...args) {
44
- if (eventName in listeners) {
45
- listeners[eventName].forEach(listener => listener(...args));
46
- }
47
- },
48
- eventNames() {
49
- return Object.keys(listeners);
50
- },
51
- });
52
- };