eslint 8.17.0 → 8.18.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 CHANGED
@@ -261,11 +261,6 @@ Brett Zamir
261
261
  Bryan Mishkin
262
262
  </a>
263
263
  </td><td align="center" valign="top" width="11%">
264
- <a href="https://github.com/mysticatea">
265
- <img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br />
266
- Toru Nagashima
267
- </a>
268
- </td><td align="center" valign="top" width="11%">
269
264
  <a href="https://github.com/SaraSoueidan">
270
265
  <img src="https://github.com/SaraSoueidan.png?s=75" width="75" height="75"><br />
271
266
  Sara Soueidan
@@ -297,7 +292,7 @@ The following companies, organizations, and individuals support ESLint's ongoing
297
292
  <!--sponsorsstart-->
298
293
  <h3>Platinum Sponsors</h3>
299
294
  <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
300
- <p><a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a> <a href="https://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3>
295
+ <p><a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a></p><h3>Silver Sponsors</h3>
301
296
  <p><a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3>
302
297
  <p><a href="https://launchdarkly.com"><img src="https://images.opencollective.com/launchdarkly/574bb9e/logo.png" alt="launchdarkly" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a></p>
303
298
  <!--sponsorsend-->
@@ -1101,7 +1101,7 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO
1101
1101
  )
1102
1102
  );
1103
1103
 
1104
- const ruleListeners = createRuleListeners(rule, ruleContext);
1104
+ const ruleListeners = timing.enabled ? timing.time(ruleId, createRuleListeners)(rule, ruleContext) : createRuleListeners(rule, ruleContext);
1105
1105
 
1106
1106
  /**
1107
1107
  * Include `ruleId` in error logs
@@ -138,10 +138,11 @@ module.exports = (function() {
138
138
 
139
139
  return function(...args) {
140
140
  let t = process.hrtime();
141
+ const result = fn(...args);
141
142
 
142
- fn(...args);
143
143
  t = process.hrtime(t);
144
144
  data[key] += t[0] * 1e3 + t[1] / 1e6;
145
+ return result;
145
146
  };
146
147
  }
147
148
 
@@ -484,12 +484,12 @@ module.exports = {
484
484
  }
485
485
 
486
486
  /**
487
- * Determine if an identifier is used either in for-in loops.
487
+ * Determine if an identifier is used either in for-in or for-of loops.
488
488
  * @param {Reference} ref The reference to check.
489
489
  * @returns {boolean} whether reference is used in the for-in loops
490
490
  * @private
491
491
  */
492
- function isForInRef(ref) {
492
+ function isForInOfRef(ref) {
493
493
  let target = ref.identifier.parent;
494
494
 
495
495
 
@@ -498,7 +498,7 @@ module.exports = {
498
498
  target = target.parent.parent;
499
499
  }
500
500
 
501
- if (target.type !== "ForInStatement") {
501
+ if (target.type !== "ForInStatement" && target.type !== "ForOfStatement") {
502
502
  return false;
503
503
  }
504
504
 
@@ -531,7 +531,7 @@ module.exports = {
531
531
  let rhsNode = null;
532
532
 
533
533
  return variable.references.some(ref => {
534
- if (isForInRef(ref)) {
534
+ if (isForInOfRef(ref)) {
535
535
  return true;
536
536
  }
537
537
 
@@ -17,14 +17,7 @@ const path = require("path");
17
17
  // Definitions for deprecation warnings.
18
18
  const deprecationWarningMessages = {
19
19
  ESLINT_LEGACY_ECMAFEATURES:
20
- "The 'ecmaFeatures' config file property is deprecated and has no effect.",
21
- ESLINT_PERSONAL_CONFIG_LOAD:
22
- "'~/.eslintrc.*' config files have been deprecated. " +
23
- "Please use a config file per project or the '--config' option.",
24
- ESLINT_PERSONAL_CONFIG_SUPPRESS:
25
- "'~/.eslintrc.*' config files have been deprecated. " +
26
- "Please remove it or add 'root:true' to the config files in your " +
27
- "projects in order to avoid loading '~/.eslintrc.*' accidentally."
20
+ "The 'ecmaFeatures' config file property is deprecated and has no effect."
28
21
  };
29
22
 
30
23
  const sourceFileErrorCache = new Set();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "8.17.0",
3
+ "version": "8.18.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {