eslint 8.14.0 → 8.15.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
@@ -235,15 +235,15 @@ Milos Djermanovic
235
235
  The people who review and implement new features.
236
236
 
237
237
  <table><tbody><tr><td align="center" valign="top" width="11%">
238
- <a href="https://github.com/mysticatea">
239
- <img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br />
240
- Toru Nagashima
241
- </a>
242
- </td><td align="center" valign="top" width="11%">
243
238
  <a href="https://github.com/aladdin-add">
244
239
  <img src="https://github.com/aladdin-add.png?s=75" width="75" height="75"><br />
245
240
  唯然
246
241
  </a>
242
+ </td><td align="center" valign="top" width="11%">
243
+ <a href="https://github.com/snitin315">
244
+ <img src="https://github.com/snitin315.png?s=75" width="75" height="75"><br />
245
+ Nitin Kumar
246
+ </a>
247
247
  </td></tr></tbody></table>
248
248
 
249
249
  ### Committers
@@ -261,6 +261,16 @@ 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
+ <a href="https://github.com/SaraSoueidan">
270
+ <img src="https://github.com/SaraSoueidan.png?s=75" width="75" height="75"><br />
271
+ Sara Soueidan
272
+ </a>
273
+ </td><td align="center" valign="top" width="11%">
264
274
  <a href="https://github.com/g-plane">
265
275
  <img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br />
266
276
  Pig Fang
@@ -275,11 +285,6 @@ Anix
275
285
  <img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
276
286
  YeonJuan
277
287
  </a>
278
- </td><td align="center" valign="top" width="11%">
279
- <a href="https://github.com/snitin315">
280
- <img src="https://github.com/snitin315.png?s=75" width="75" height="75"><br />
281
- Nitin Kumar
282
- </a>
283
288
  </td></tr></tbody></table>
284
289
 
285
290
  <!--teamend-->
@@ -292,9 +297,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
292
297
  <!--sponsorsstart-->
293
298
  <h3>Platinum Sponsors</h3>
294
299
  <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>
295
- <p><a href="https://contra.com"><img src="https://images.opencollective.com/contra1/c70f93f/logo.png" alt="Contra" height="96"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <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>
300
+ <p><a href="https://contra.com"><img src="https://images.opencollective.com/contra1/c70f93f/logo.png" alt="Contra" height="96"></a> <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>
296
301
  <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>
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://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></p>
302
+ <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></p>
298
303
  <!--sponsorsend-->
299
304
 
300
305
  ## <a name="technology-sponsors"></a>Technology Sponsors
@@ -49,6 +49,10 @@ module.exports = {
49
49
  allowFunctionParams: {
50
50
  type: "boolean",
51
51
  default: true
52
+ },
53
+ enforceInClassFields: {
54
+ type: "boolean",
55
+ default: false
52
56
  }
53
57
  },
54
58
  additionalProperties: false
@@ -68,6 +72,7 @@ module.exports = {
68
72
  const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false;
69
73
  const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false;
70
74
  const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false;
75
+ const enforceInClassFields = typeof options.enforceInClassFields !== "undefined" ? options.enforceInClassFields : false;
71
76
  const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true;
72
77
 
73
78
  //-------------------------------------------------------------------------
@@ -261,6 +266,30 @@ module.exports = {
261
266
  }
262
267
  }
263
268
 
269
+ /**
270
+ * Check if a class field has a dangling underscore
271
+ * @param {ASTNode} node node to evaluate
272
+ * @returns {void}
273
+ * @private
274
+ */
275
+ function checkForDanglingUnderscoreInClassField(node) {
276
+ const identifier = node.key.name;
277
+
278
+ if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) &&
279
+ enforceInClassFields &&
280
+ !isAllowed(identifier)) {
281
+ context.report({
282
+ node,
283
+ messageId: "unexpectedUnderscore",
284
+ data: {
285
+ identifier: node.key.type === "PrivateIdentifier"
286
+ ? `#${identifier}`
287
+ : identifier
288
+ }
289
+ });
290
+ }
291
+ }
292
+
264
293
  //--------------------------------------------------------------------------
265
294
  // Public API
266
295
  //--------------------------------------------------------------------------
@@ -270,7 +299,7 @@ module.exports = {
270
299
  VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
271
300
  MemberExpression: checkForDanglingUnderscoreInMemberExpression,
272
301
  MethodDefinition: checkForDanglingUnderscoreInMethod,
273
- PropertyDefinition: checkForDanglingUnderscoreInMethod,
302
+ PropertyDefinition: checkForDanglingUnderscoreInClassField,
274
303
  Property: checkForDanglingUnderscoreInMethod,
275
304
  FunctionExpression: checkForDanglingUnderscoreInFunction,
276
305
  ArrowFunctionExpression: checkForDanglingUnderscoreInFunction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "8.14.0",
3
+ "version": "8.15.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {
@@ -47,7 +47,7 @@
47
47
  "homepage": "https://eslint.org",
48
48
  "bugs": "https://github.com/eslint/eslint/issues/",
49
49
  "dependencies": {
50
- "@eslint/eslintrc": "^1.2.2",
50
+ "@eslint/eslintrc": "^1.2.3",
51
51
  "@humanwhocodes/config-array": "^0.9.2",
52
52
  "ajv": "^6.10.0",
53
53
  "chalk": "^4.0.0",
@@ -58,7 +58,7 @@
58
58
  "eslint-scope": "^7.1.1",
59
59
  "eslint-utils": "^3.0.0",
60
60
  "eslint-visitor-keys": "^3.3.0",
61
- "espree": "^9.3.1",
61
+ "espree": "^9.3.2",
62
62
  "esquery": "^1.4.0",
63
63
  "esutils": "^2.0.2",
64
64
  "fast-deep-equal": "^3.1.3",
@@ -74,7 +74,7 @@
74
74
  "json-stable-stringify-without-jsonify": "^1.0.1",
75
75
  "levn": "^0.4.1",
76
76
  "lodash.merge": "^4.6.2",
77
- "minimatch": "^3.0.4",
77
+ "minimatch": "^3.1.2",
78
78
  "natural-compare": "^1.4.0",
79
79
  "optionator": "^0.9.1",
80
80
  "regexpp": "^3.2.0",