eslint 9.0.0-rc.0 → 9.0.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.
@@ -189,11 +189,45 @@ module.exports = {};
189
189
  * @property {number} warningCount Number of warnings for the result.
190
190
  * @property {number} fixableErrorCount Number of fixable errors for the result.
191
191
  * @property {number} fixableWarningCount Number of fixable warnings for the result.
192
+ * @property {Stats} [stats] The performance statistics collected with the `stats` flag.
192
193
  * @property {string} [source] The source code of the file that was linted.
193
194
  * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible.
194
195
  * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules.
195
196
  */
196
197
 
198
+ /**
199
+ * Performance statistics
200
+ * @typedef {Object} Stats
201
+ * @property {number} fixPasses The number of times ESLint has applied at least one fix after linting.
202
+ * @property {Times} times The times spent on (parsing, fixing, linting) a file.
203
+ */
204
+
205
+ /**
206
+ * Performance Times for each ESLint pass
207
+ * @typedef {Object} Times
208
+ * @property {TimePass[]} passes Time passes
209
+ */
210
+
211
+ /**
212
+ * @typedef {Object} TimePass
213
+ * @property {ParseTime} parse The parse object containing all parse time information.
214
+ * @property {Record<string, RuleTime>} [rules] The rules object containing all lint time information for each rule.
215
+ * @property {FixTime} fix The parse object containing all fix time information.
216
+ * @property {number} total The total time that is spent on (parsing, fixing, linting) a file.
217
+ */
218
+ /**
219
+ * @typedef {Object} ParseTime
220
+ * @property {number} total The total time that is spent when parsing a file.
221
+ */
222
+ /**
223
+ * @typedef {Object} RuleTime
224
+ * @property {number} total The total time that is spent on a rule.
225
+ */
226
+ /**
227
+ * @typedef {Object} FixTime
228
+ * @property {number} total The total time that is spent on applying fixes to the code.
229
+ */
230
+
197
231
  /**
198
232
  * Information provided when the maximum warning threshold is exceeded.
199
233
  * @typedef {Object} MaxWarningsExceeded
@@ -9,7 +9,7 @@
9
9
  //------------------------------------------------------------------------------
10
10
 
11
11
  const Cursor = require("./cursor");
12
- const utils = require("./utils");
12
+ const { getLastIndex, getFirstIndex } = require("./utils");
13
13
 
14
14
  //------------------------------------------------------------------------------
15
15
  // Exports
@@ -31,8 +31,8 @@ module.exports = class BackwardTokenCursor extends Cursor {
31
31
  constructor(tokens, comments, indexMap, startLoc, endLoc) {
32
32
  super();
33
33
  this.tokens = tokens;
34
- this.index = utils.getLastIndex(tokens, indexMap, endLoc);
35
- this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc);
34
+ this.index = getLastIndex(tokens, indexMap, endLoc);
35
+ this.indexEnd = getFirstIndex(tokens, indexMap, startLoc);
36
36
  }
37
37
 
38
38
  /** @inheritdoc */
@@ -86,5 +86,7 @@ class CursorFactory {
86
86
  // Exports
87
87
  //------------------------------------------------------------------------------
88
88
 
89
- exports.forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor);
90
- exports.backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor);
89
+ module.exports = {
90
+ forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor),
91
+ backward: new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor)
92
+ };
@@ -9,7 +9,7 @@
9
9
  //------------------------------------------------------------------------------
10
10
 
11
11
  const Cursor = require("./cursor");
12
- const utils = require("./utils");
12
+ const { getFirstIndex, search } = require("./utils");
13
13
 
14
14
  //------------------------------------------------------------------------------
15
15
  // Exports
@@ -32,8 +32,8 @@ module.exports = class ForwardTokenCommentCursor extends Cursor {
32
32
  super();
33
33
  this.tokens = tokens;
34
34
  this.comments = comments;
35
- this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc);
36
- this.commentIndex = utils.search(comments, startLoc);
35
+ this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc);
36
+ this.commentIndex = search(comments, startLoc);
37
37
  this.border = endLoc;
38
38
  }
39
39
 
@@ -9,7 +9,7 @@
9
9
  //------------------------------------------------------------------------------
10
10
 
11
11
  const Cursor = require("./cursor");
12
- const utils = require("./utils");
12
+ const { getFirstIndex, getLastIndex } = require("./utils");
13
13
 
14
14
  //------------------------------------------------------------------------------
15
15
  // Exports
@@ -31,8 +31,8 @@ module.exports = class ForwardTokenCursor extends Cursor {
31
31
  constructor(tokens, comments, indexMap, startLoc, endLoc) {
32
32
  super();
33
33
  this.tokens = tokens;
34
- this.index = utils.getFirstIndex(tokens, indexMap, startLoc);
35
- this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc);
34
+ this.index = getFirstIndex(tokens, indexMap, startLoc);
35
+ this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
36
36
  }
37
37
 
38
38
  /** @inheritdoc */
@@ -15,7 +15,7 @@ module.exports = function(it) {
15
15
 
16
16
  Please remove the "plugins" setting from either config or remove either plugin installation.
17
17
 
18
- If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
18
+ If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
19
19
  `;
20
20
 
21
21
  return result;
@@ -11,6 +11,6 @@ module.exports = function(it) {
11
11
 
12
12
  "${configName}" was referenced from the config file in "${importerName}".
13
13
 
14
- If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
14
+ If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
15
15
  `.trimStart();
16
16
  };
@@ -14,6 +14,6 @@ It's likely that the plugin isn't installed correctly. Try reinstalling by runni
14
14
 
15
15
  The plugin "${pluginName}" was referenced from the config file in "${importerName}".
16
16
 
17
- If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
17
+ If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
18
18
  `.trimStart();
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "9.0.0-rc.0",
3
+ "version": "9.0.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {
@@ -30,6 +30,7 @@
30
30
  "release:generate:rc": "node Makefile.js generatePrerelease -- rc",
31
31
  "release:publish": "node Makefile.js publishRelease",
32
32
  "test": "node Makefile.js test",
33
+ "test:browser": "node Makefile.js wdio",
33
34
  "test:cli": "mocha",
34
35
  "test:fuzz": "node Makefile.js fuzz",
35
36
  "test:performance": "node Makefile.js perf"
@@ -67,8 +68,8 @@
67
68
  "@eslint-community/eslint-utils": "^4.2.0",
68
69
  "@eslint-community/regexpp": "^4.6.1",
69
70
  "@eslint/eslintrc": "^3.0.2",
70
- "@eslint/js": "9.0.0-rc.0",
71
- "@humanwhocodes/config-array": "^0.11.14",
71
+ "@eslint/js": "9.0.0",
72
+ "@humanwhocodes/config-array": "^0.12.3",
72
73
  "@humanwhocodes/module-importer": "^1.0.1",
73
74
  "@nodelib/fs.walk": "^1.2.8",
74
75
  "ajv": "^6.12.4",
@@ -134,12 +135,12 @@
134
135
  "got": "^11.8.3",
135
136
  "gray-matter": "^4.0.3",
136
137
  "js-yaml": "^4.1.0",
137
- "knip": "^5.0.1",
138
+ "knip": "^5.8.0",
138
139
  "lint-staged": "^11.0.0",
139
140
  "load-perf": "^0.2.0",
140
141
  "markdown-it": "^12.2.0",
141
142
  "markdown-it-container": "^3.0.0",
142
- "markdownlint": "^0.33.0",
143
+ "markdownlint": "^0.34.0",
143
144
  "markdownlint-cli": "^0.39.0",
144
145
  "marked": "^4.0.8",
145
146
  "metascraper": "^5.25.7",