eslint 9.39.0 → 10.0.0-alpha.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 (42) hide show
  1. package/README.md +3 -3
  2. package/bin/eslint.js +1 -2
  3. package/lib/api.js +4 -15
  4. package/lib/cli.js +14 -56
  5. package/lib/config/config-loader.js +6 -154
  6. package/lib/eslint/eslint-helpers.js +5 -8
  7. package/lib/eslint/eslint.js +1 -1
  8. package/lib/eslint/index.js +0 -2
  9. package/lib/languages/js/source-code/source-code.js +41 -89
  10. package/lib/languages/js/source-code/token-store/utils.js +29 -8
  11. package/lib/linter/apply-disable-directives.js +0 -1
  12. package/lib/linter/file-context.js +0 -56
  13. package/lib/linter/file-report.js +0 -4
  14. package/lib/linter/linter.js +45 -1086
  15. package/lib/linter/rule-fixer.js +30 -0
  16. package/lib/options.js +62 -182
  17. package/lib/rule-tester/rule-tester.js +255 -194
  18. package/lib/rules/dot-notation.js +2 -2
  19. package/lib/rules/func-names.js +2 -0
  20. package/lib/rules/no-eval.js +1 -1
  21. package/lib/rules/no-invalid-regexp.js +1 -0
  22. package/lib/rules/no-shadow-restricted-names.js +1 -1
  23. package/lib/rules/no-unassigned-vars.js +1 -1
  24. package/lib/rules/no-useless-assignment.js +1 -1
  25. package/lib/rules/preserve-caught-error.js +1 -1
  26. package/lib/rules/radix.js +25 -48
  27. package/lib/services/parser-service.js +0 -1
  28. package/lib/services/processor-service.js +0 -1
  29. package/lib/services/warning-service.js +0 -11
  30. package/lib/shared/flags.js +0 -19
  31. package/lib/shared/translate-cli-options.js +106 -164
  32. package/lib/types/index.d.ts +7 -60
  33. package/lib/types/rules.d.ts +11 -2
  34. package/lib/types/use-at-your-own-risk.d.ts +1 -54
  35. package/lib/unsupported-api.js +3 -6
  36. package/package.json +14 -19
  37. package/conf/default-cli-options.js +0 -32
  38. package/lib/cli-engine/cli-engine.js +0 -1109
  39. package/lib/cli-engine/file-enumerator.js +0 -541
  40. package/lib/cli-engine/index.js +0 -7
  41. package/lib/cli-engine/load-rules.js +0 -46
  42. package/lib/eslint/legacy-eslint.js +0 -786
@@ -25,63 +25,10 @@
25
25
  * SOFTWARE
26
26
  */
27
27
 
28
- import { ESLint, Rule } from "./index.js";
28
+ import { Rule } from "./index.js";
29
29
 
30
30
  /** @deprecated */
31
31
  export const builtinRules: Map<string, Rule.RuleModule>;
32
32
 
33
- /** @deprecated */
34
- export class FileEnumerator {
35
- constructor(params?: {
36
- cwd?: string;
37
- configArrayFactory?: any;
38
- extensions?: any;
39
- globInputPaths?: boolean;
40
- errorOnUnmatchedPattern?: boolean;
41
- ignore?: boolean;
42
- });
43
- isTargetPath(filePath: string, providedConfig?: any): boolean;
44
- iterateFiles(
45
- patternOrPatterns: string | string[],
46
- ): IterableIterator<{ config: any; filePath: string; ignored: boolean }>;
47
- }
48
-
49
- export { /** @deprecated */ ESLint as FlatESLint };
50
-
51
- /** @deprecated */
52
- export class LegacyESLint {
53
- static configType: "eslintrc";
54
-
55
- static readonly version: string;
56
-
57
- static outputFixes(results: ESLint.LintResult[]): Promise<void>;
58
-
59
- static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];
60
-
61
- constructor(options?: ESLint.LegacyOptions);
62
-
63
- lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;
64
-
65
- lintText(
66
- code: string,
67
- options?: {
68
- filePath?: string | undefined;
69
- warnIgnored?: boolean | undefined;
70
- },
71
- ): Promise<ESLint.LintResult[]>;
72
-
73
- getRulesMetaForResults(
74
- results: ESLint.LintResult[],
75
- ): ESLint.LintResultData["rulesMeta"];
76
-
77
- hasFlag(flag: string): false;
78
-
79
- calculateConfigForFile(filePath: string): Promise<any>;
80
-
81
- isPathIgnored(filePath: string): Promise<boolean>;
82
-
83
- loadFormatter(nameOrPath?: string): Promise<ESLint.Formatter>;
84
- }
85
-
86
33
  /** @deprecated */
87
34
  export function shouldUseFlatConfig(): Promise<boolean>;
@@ -11,9 +11,7 @@
11
11
  // Requirements
12
12
  //-----------------------------------------------------------------------------
13
13
 
14
- const { FileEnumerator } = require("./cli-engine/file-enumerator");
15
- const { ESLint: FlatESLint, shouldUseFlatConfig } = require("./eslint/eslint");
16
- const { LegacyESLint } = require("./eslint/legacy-eslint");
14
+ const { shouldUseFlatConfig } = require("./eslint/eslint");
17
15
  const builtinRules = require("./rules");
18
16
 
19
17
  //-----------------------------------------------------------------------------
@@ -22,8 +20,7 @@ const builtinRules = require("./rules");
22
20
 
23
21
  module.exports = {
24
22
  builtinRules,
25
- FlatESLint,
23
+ FlatESLint: null,
24
+ LegacyESLint: null,
26
25
  shouldUseFlatConfig,
27
- FileEnumerator,
28
- LegacyESLint,
29
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "9.39.0",
3
+ "version": "10.0.0-alpha.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",
@@ -108,12 +108,10 @@
108
108
  "dependencies": {
109
109
  "@eslint-community/eslint-utils": "^4.8.0",
110
110
  "@eslint-community/regexpp": "^4.12.1",
111
- "@eslint/config-array": "^0.21.1",
112
- "@eslint/config-helpers": "^0.4.2",
113
- "@eslint/core": "^0.17.0",
114
- "@eslint/eslintrc": "^3.3.1",
115
- "@eslint/js": "9.39.0",
116
- "@eslint/plugin-kit": "^0.4.1",
111
+ "@eslint/config-array": "^0.22.0",
112
+ "@eslint/config-helpers": "^0.5.0",
113
+ "@eslint/core": "^1.0.0",
114
+ "@eslint/plugin-kit": "^0.5.0",
117
115
  "@humanfs/node": "^0.16.6",
118
116
  "@humanwhocodes/module-importer": "^1.0.1",
119
117
  "@humanwhocodes/retry": "^0.4.2",
@@ -123,9 +121,9 @@
123
121
  "cross-spawn": "^7.0.6",
124
122
  "debug": "^4.3.2",
125
123
  "escape-string-regexp": "^4.0.0",
126
- "eslint-scope": "^8.4.0",
127
- "eslint-visitor-keys": "^4.2.1",
128
- "espree": "^10.4.0",
124
+ "eslint-scope": "^9.0.0",
125
+ "eslint-visitor-keys": "^5.0.0",
126
+ "espree": "^11.0.0",
129
127
  "esquery": "^1.5.0",
130
128
  "esutils": "^2.0.2",
131
129
  "fast-deep-equal": "^3.1.3",
@@ -136,7 +134,6 @@
136
134
  "imurmurhash": "^0.1.4",
137
135
  "is-glob": "^4.0.0",
138
136
  "json-stable-stringify-without-jsonify": "^1.0.1",
139
- "lodash.merge": "^4.6.2",
140
137
  "minimatch": "^3.1.2",
141
138
  "natural-compare": "^1.4.0",
142
139
  "optionator": "^0.9.3"
@@ -146,11 +143,12 @@
146
143
  "@babel/core": "^7.4.3",
147
144
  "@babel/preset-env": "^7.4.3",
148
145
  "@cypress/webpack-preprocessor": "^6.0.2",
149
- "@eslint/json": "^0.13.2",
146
+ "@eslint/json": "^0.14.0",
147
+ "@eslint/eslintrc": "^3.3.1",
150
148
  "@trunkio/launcher": "^1.3.4",
151
149
  "@types/esquery": "^1.5.4",
152
150
  "@types/node": "^22.13.14",
153
- "@typescript-eslint/parser": "^8.4.0",
151
+ "@typescript-eslint/parser": "file:tools/typescript-eslint-parser",
154
152
  "babel-loader": "^8.0.5",
155
153
  "c8": "^7.12.0",
156
154
  "chai": "^4.0.1",
@@ -165,18 +163,15 @@
165
163
  "eslint-plugin-expect-type": "^0.6.0",
166
164
  "eslint-plugin-yml": "^1.14.0",
167
165
  "eslint-release": "^3.3.0",
168
- "eslint-rule-composer": "^0.3.0",
166
+ "eslint-rule-extender": "^0.0.1",
169
167
  "eslump": "^3.0.0",
170
168
  "esprima": "^4.0.1",
171
- "fast-glob": "^3.2.11",
172
169
  "fs-teardown": "^0.1.3",
173
170
  "glob": "^10.0.0",
174
171
  "globals": "^16.2.0",
175
172
  "got": "^11.8.3",
176
173
  "gray-matter": "^4.0.3",
177
174
  "jiti": "^2.6.1",
178
- "jiti-v2.0": "npm:jiti@2.0.x",
179
- "jiti-v2.1": "npm:jiti@2.1.x",
180
175
  "knip": "^5.60.2",
181
176
  "lint-staged": "^11.0.0",
182
177
  "markdown-it": "^12.2.0",
@@ -191,7 +186,7 @@
191
186
  "mocha": "^11.7.1",
192
187
  "node-polyfill-webpack-plugin": "^1.0.3",
193
188
  "npm-license": "^0.3.3",
194
- "pirates": "^4.0.5",
189
+ "prettier": "3.5.3",
195
190
  "progress": "^2.0.3",
196
191
  "proxyquire": "^2.0.1",
197
192
  "recast": "^0.23.0",
@@ -221,6 +216,6 @@
221
216
  ],
222
217
  "license": "MIT",
223
218
  "engines": {
224
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
219
+ "node": "^20.19.0 || ^22.13.0 || >=24"
225
220
  }
226
221
  }
@@ -1,32 +0,0 @@
1
- /**
2
- * @fileoverview Default CLIEngineOptions.
3
- * @author Ian VanSchooten
4
- */
5
-
6
- "use strict";
7
-
8
- module.exports = {
9
- configFile: null,
10
- baseConfig: false,
11
- rulePaths: [],
12
- useEslintrc: true,
13
- envs: [],
14
- globals: [],
15
- extensions: null,
16
- ignore: true,
17
- ignorePath: void 0,
18
- cache: false,
19
-
20
- /*
21
- * in order to honor the cacheFile option if specified
22
- * this option should not have a default value otherwise
23
- * it will always be used
24
- */
25
- cacheLocation: "",
26
- cacheFile: ".eslintcache",
27
- cacheStrategy: "metadata",
28
- fix: false,
29
- allowInlineConfig: true,
30
- reportUnusedDisableDirectives: void 0,
31
- globInputPaths: true,
32
- };