eslint 10.0.0-alpha.1 → 10.0.0-rc.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 +2 -2
- package/lib/api.js +2 -2
- package/lib/cli-engine/formatters/stylish.js +65 -34
- package/lib/cli.js +18 -8
- package/lib/eslint/eslint.js +4 -2
- package/lib/languages/js/index.js +1 -1
- package/lib/linter/linter.js +15 -22
- package/lib/rule-tester/rule-tester.js +646 -307
- package/lib/rules/max-params.js +29 -10
- package/lib/rules/no-restricted-imports.js +56 -14
- package/lib/rules/no-useless-assignment.js +8 -5
- package/lib/rules/utils/ast-utils.js +39 -36
- package/lib/types/index.d.ts +110 -27
- package/lib/types/rules.d.ts +5 -0
- package/lib/types/use-at-your-own-risk.d.ts +1 -1
- package/package.json +7 -8
- package/lib/linter/rules.js +0 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint",
|
|
3
|
-
"version": "10.0.0-
|
|
3
|
+
"version": "10.0.0-rc.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",
|
|
@@ -107,17 +107,16 @@
|
|
|
107
107
|
"bugs": "https://github.com/eslint/eslint/issues/",
|
|
108
108
|
"dependencies": {
|
|
109
109
|
"@eslint-community/eslint-utils": "^4.8.0",
|
|
110
|
-
"@eslint-community/regexpp": "^4.12.
|
|
110
|
+
"@eslint-community/regexpp": "^4.12.2",
|
|
111
111
|
"@eslint/config-array": "^0.23.0",
|
|
112
|
-
"@eslint/config-helpers": "^0.5.
|
|
113
|
-
"@eslint/core": "^1.0.
|
|
114
|
-
"@eslint/plugin-kit": "^0.5.
|
|
112
|
+
"@eslint/config-helpers": "^0.5.1",
|
|
113
|
+
"@eslint/core": "^1.0.1",
|
|
114
|
+
"@eslint/plugin-kit": "^0.5.1",
|
|
115
115
|
"@humanfs/node": "^0.16.6",
|
|
116
116
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
117
117
|
"@humanwhocodes/retry": "^0.4.2",
|
|
118
118
|
"@types/estree": "^1.0.6",
|
|
119
119
|
"ajv": "^6.12.4",
|
|
120
|
-
"chalk": "^4.0.0",
|
|
121
120
|
"cross-spawn": "^7.0.6",
|
|
122
121
|
"debug": "^4.3.2",
|
|
123
122
|
"escape-string-regexp": "^4.0.0",
|
|
@@ -144,7 +143,7 @@
|
|
|
144
143
|
"@babel/preset-env": "^7.4.3",
|
|
145
144
|
"@cypress/webpack-preprocessor": "^6.0.2",
|
|
146
145
|
"@eslint/json": "^0.14.0",
|
|
147
|
-
"@eslint/eslintrc": "^3.3.
|
|
146
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
148
147
|
"@trunkio/launcher": "^1.3.4",
|
|
149
148
|
"@types/esquery": "^1.5.4",
|
|
150
149
|
"@types/node": "^22.13.14",
|
|
@@ -194,7 +193,7 @@
|
|
|
194
193
|
"semver": "^7.5.3",
|
|
195
194
|
"shelljs": "^0.10.0",
|
|
196
195
|
"sinon": "^11.0.0",
|
|
197
|
-
"typescript": "^5.
|
|
196
|
+
"typescript": "^5.9.3",
|
|
198
197
|
"webpack": "^5.23.0",
|
|
199
198
|
"webpack-cli": "^4.5.0",
|
|
200
199
|
"yorkie": "^2.0.0"
|
package/lib/linter/rules.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines a storage for rules.
|
|
3
|
-
* @author Nicholas C. Zakas
|
|
4
|
-
* @author aladdin-add
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
"use strict";
|
|
8
|
-
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
// Requirements
|
|
11
|
-
//------------------------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
const builtInRules = require("../rules");
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Typedefs
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
/** @typedef {import("../types").Rule.RuleModule} Rule */
|
|
20
|
-
|
|
21
|
-
//------------------------------------------------------------------------------
|
|
22
|
-
// Public Interface
|
|
23
|
-
//------------------------------------------------------------------------------
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A storage for rules.
|
|
27
|
-
*/
|
|
28
|
-
class Rules {
|
|
29
|
-
constructor() {
|
|
30
|
-
this._rules = Object.create(null);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Registers a rule module for rule id in storage.
|
|
35
|
-
* @param {string} ruleId Rule id (file name).
|
|
36
|
-
* @param {Rule} rule Rule object.
|
|
37
|
-
* @returns {void}
|
|
38
|
-
*/
|
|
39
|
-
define(ruleId, rule) {
|
|
40
|
-
this._rules[ruleId] = rule;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Access rule handler by id (file name).
|
|
45
|
-
* @param {string} ruleId Rule id (file name).
|
|
46
|
-
* @returns {Rule} Rule object.
|
|
47
|
-
*/
|
|
48
|
-
get(ruleId) {
|
|
49
|
-
if (typeof this._rules[ruleId] === "string") {
|
|
50
|
-
this.define(ruleId, require(this._rules[ruleId]));
|
|
51
|
-
}
|
|
52
|
-
if (this._rules[ruleId]) {
|
|
53
|
-
return this._rules[ruleId];
|
|
54
|
-
}
|
|
55
|
-
if (builtInRules.has(ruleId)) {
|
|
56
|
-
return builtInRules.get(ruleId);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
*[Symbol.iterator]() {
|
|
63
|
-
yield* builtInRules;
|
|
64
|
-
|
|
65
|
-
for (const ruleId of Object.keys(this._rules)) {
|
|
66
|
-
yield [ruleId, this.get(ruleId)];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
module.exports = Rules;
|