eslint 7.6.0 → 7.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ v7.7.0 - August 14, 2020
2
+
3
+ * [`b46f3ee`](https://github.com/eslint/eslint/commit/b46f3ee0dae4add9df99cae940b641ad8de58b9e) Update: allowFunctionParams option in no-underscore-dangle (fixes 12579) (#13545) (Sunghyun Cho)
4
+ * [`26aa245`](https://github.com/eslint/eslint/commit/26aa2452b5f407fabc25dad21182180e4d3be532) Docs: clarify "case" specifier in padding-line-between-statements (#13562) (Milos Djermanovic)
5
+ * [`082891c`](https://github.com/eslint/eslint/commit/082891c042d72953fe86cd3ce9c96e661760793d) Docs: Update semantic versioning policy (#13563) (Nicholas C. Zakas)
6
+ * [`4e0b672`](https://github.com/eslint/eslint/commit/4e0b672eb4bf39f7502a550b08b25a56a196f19f) Fix: revert "Update: disallow multiple options in comma-dangle schema" (#13564) (Kai Cataldo)
7
+ * [`254990e`](https://github.com/eslint/eslint/commit/254990e87914457ca25ea2d7ee012964e56fc9e5) Fix: indent for async arrow functions (fixes #13497) (#13544) (Anix)
8
+ * [`28ca339`](https://github.com/eslint/eslint/commit/28ca339259b07c96c73f2ef28cbf112b96395855) Sponsors: Sync README with website (ESLint Jenkins)
9
+ * [`2e4158d`](https://github.com/eslint/eslint/commit/2e4158d3ec9cfed6400bf70795fd7171e96ff9b3) Sponsors: Sync README with website (ESLint Jenkins)
10
+ * [`488d159`](https://github.com/eslint/eslint/commit/488d1595aef43c4d52cccdb2c97977884f0375a8) Sponsors: Sync README with website (ESLint Jenkins)
11
+ * [`c44306e`](https://github.com/eslint/eslint/commit/c44306e52778309a79232ceab8b55a9aa0f2dfda) Sponsors: Sync README with website (ESLint Jenkins)
12
+ * [`6677180`](https://github.com/eslint/eslint/commit/6677180495e16a02d150d0552e7e5d5f6b77fcc5) Sponsors: Sync README with website (ESLint Jenkins)
13
+ * [`07db7b8`](https://github.com/eslint/eslint/commit/07db7b8080c2f68ee28e7d447db356c33e6fddce) Sponsors: Sync README with website (ESLint Jenkins)
14
+ * [`d4ce4d3`](https://github.com/eslint/eslint/commit/d4ce4d3b8492c3e4654ed1f51f2c48e6c0ad272f) Sponsors: Sync README with website (ESLint Jenkins)
15
+ * [`284e954`](https://github.com/eslint/eslint/commit/284e954f93126c50e0aa9b88f42afb03a47ad967) Sponsors: Sync README with website (ESLint Jenkins)
16
+ * [`ae9b54e`](https://github.com/eslint/eslint/commit/ae9b54e59b01aa9f50ee31f5b6787d86e6b59de6) Sponsors: Sync README with website (ESLint Jenkins)
17
+ * [`9124a15`](https://github.com/eslint/eslint/commit/9124a1599638a1caf4b7e252d1cb66abdc5e51c6) Chore: remove leche (fixes #13287) (#13533) (Mark de Dios)
18
+ * [`5c4c7f5`](https://github.com/eslint/eslint/commit/5c4c7f515c2e8e83f2186a66ddce75d6477abeb0) Sponsors: Sync README with website (ESLint Jenkins)
19
+ * [`48d8ec8`](https://github.com/eslint/eslint/commit/48d8ec8cf320c69aed17c6b6c78f19e7c1e587ca) Sponsors: Sync README with website (ESLint Jenkins)
20
+
1
21
  v7.6.0 - July 31, 2020
2
22
 
3
23
  * [`ecb2b73`](https://github.com/eslint/eslint/commit/ecb2b7343a0d14fb57d297a16be6c1b176fb3dbf) Update: require `meta` for fixable rules in RuleTester (refs #13349) (#13489) (Milos Djermanovic)
package/README.md CHANGED
@@ -149,27 +149,32 @@ ESLint takes security seriously. We work hard to ensure that ESLint is safe for
149
149
  ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
150
150
 
151
151
  * Patch release (intended to not break your lint build)
152
- * A bug fix in a rule that results in ESLint reporting fewer errors.
152
+ * A bug fix in a rule that results in ESLint reporting fewer linting errors.
153
153
  * A bug fix to the CLI or core (including formatters).
154
154
  * Improvements to documentation.
155
155
  * Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
156
156
  * Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
157
157
  * Minor release (might break your lint build)
158
- * A bug fix in a rule that results in ESLint reporting more errors.
158
+ * A bug fix in a rule that results in ESLint reporting more linting errors.
159
159
  * A new rule is created.
160
- * A new option to an existing rule that does not result in ESLint reporting more errors by default.
160
+ * A new option to an existing rule that does not result in ESLint reporting more linting errors by default.
161
161
  * An existing rule is deprecated.
162
162
  * A new CLI capability is created.
163
163
  * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.).
164
164
  * A new formatter is created.
165
- * `eslint:recommended` is updated and will result in strictly fewer errors (e.g., rule removals).
165
+ * `eslint:recommended` is updated and will result in strictly fewer linting errors (e.g., rule removals).
166
166
  * Major release (likely to break your lint build)
167
- * `eslint:recommended` is updated and may result in new errors (e.g., rule additions, most rule option updates).
168
- * A new option to an existing rule that results in ESLint reporting more errors by default.
167
+ * `eslint:recommended` is updated and may result in new linting errors (e.g., rule additions, most rule option updates).
168
+ * A new option to an existing rule that results in ESLint reporting more linting errors by default.
169
169
  * An existing formatter is removed.
170
- * Part of the public API is removed or changed in an incompatible way.
170
+ * Part of the public API is removed or changed in an incompatible way. The public API includes:
171
+ * Rule schemas
172
+ * Configuration schema
173
+ * Command-line options
174
+ * Node.js API
175
+ * Rule, formatter, parser, plugin APIs
171
176
 
172
- According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
177
+ According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
173
178
 
174
179
  ## <a name="license"></a>License
175
180
 
@@ -206,6 +211,11 @@ Toru Nagashima
206
211
  <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
207
212
  Kai Cataldo
208
213
  </a>
214
+ </td><td align="center" valign="top" width="11%">
215
+ <a href="https://github.com/mdjermanovic">
216
+ <img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
217
+ Milos Djermanovic
218
+ </a>
209
219
  </td></tr></tbody></table>
210
220
 
211
221
 
@@ -218,11 +228,6 @@ The people who review and implement new features.
218
228
  <img src="https://github.com/aladdin-add.png?s=75" width="75" height="75"><br />
219
229
  薛定谔的猫
220
230
  </a>
221
- </td><td align="center" valign="top" width="11%">
222
- <a href="https://github.com/mdjermanovic">
223
- <img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
224
- Milos Djermanovic
225
- </a>
226
231
  </td></tr></tbody></table>
227
232
 
228
233
 
@@ -238,6 +243,11 @@ The people who review and fix bugs and help triage issues.
238
243
  Pig Fang
239
244
  </a>
240
245
  </td><td align="center" valign="top" width="11%">
246
+ <a href="https://github.com/anikethsaha">
247
+ <img src="https://github.com/anikethsaha.png?s=75" width="75" height="75"><br />
248
+ Anix
249
+ </a>
250
+ </td><td align="center" valign="top" width="11%">
241
251
  <a href="https://github.com/yeonjuan">
242
252
  <img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
243
253
  YeonJuan
@@ -254,9 +264,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
254
264
  <!-- NOTE: This section is autogenerated. Do not manually edit.-->
255
265
  <!--sponsorsstart-->
256
266
  <h3>Gold Sponsors</h3>
257
- <p><a href="https://www.shopify.com"><img src="https://images.opencollective.com/shopify/e780cd4/logo.png" alt="Shopify" 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://aka.ms/microsoftfossfund"><img src="https://avatars1.githubusercontent.com/u/67931232?u=7fddc652a464d7151b97e8f108392af7d54fa3e8&v=4" alt="Microsoft FOSS Fund Sponsorships" height="96"></a></p><h3>Silver Sponsors</h3>
267
+ <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://aka.ms/microsoftfossfund"><img src="https://avatars1.githubusercontent.com/u/67931232?u=7fddc652a464d7151b97e8f108392af7d54fa3e8&v=4" alt="Microsoft FOSS Fund Sponsorships" height="96"></a></p><h3>Silver Sponsors</h3>
258
268
  <p><a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://www.ampproject.org/"><img src="https://images.opencollective.com/amp/c8a3b25/logo.png" alt="AMP Project" height="64"></a></p><h3>Bronze Sponsors</h3>
259
- <p><a href="https://www.veikkaajat.com"><img src="https://images.opencollective.com/veikkaajat/b92b427/logo.png" alt="Veikkaajat.com" height="32"></a> <a href="https://www.nettikasinot.media/"><img src="https://images.opencollective.com/nettikasinot-media/2dba7da/logo.png" alt="Nettikasinot.media" height="32"></a> <a href="https://mytruemedia.com/"><img src="https://images.opencollective.com/my-true-media/03e2168/logo.png" alt="My True Media" height="32"></a> <a href="https://www.norgekasino.com"><img src="https://images.opencollective.com/norgekasino/ecfd57a/logo.png" alt="Norgekasino" height="32"></a> <a href="https://www.japanesecasino.com/"><img src="https://images.opencollective.com/japanesecasino/b0ffe3c/logo.png" alt="Japanesecasino" height="32"></a> <a href="https://bruce.agency"><img src="https://images.opencollective.com/brucemade/0c70c59/logo.png" alt="Bruce" height="32"></a> <a href="https://edubirdie.com/"><img src="https://images.opencollective.com/edubirdie2/b1d51ab/logo.png" alt="EduBirdie" height="32"></a> <a href="https://www.casinotop.com/"><img src="https://images.opencollective.com/casinotop-com/10fd95b/logo.png" alt="CasinoTop.com" height="32"></a> <a href="https://www.casinotopp.net/"><img src="https://images.opencollective.com/casino-topp/1dd399a/logo.png" alt="Casino Topp" height="32"></a> <a href="https://writersperhour.com/write-my-essay"><img src="https://images.opencollective.com/writersperhour/5787d4b/logo.png" alt="Writers Per Hour" 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.kasinot.fi"><img src="https://images.opencollective.com/kasinot-fi/e09aa2e/logo.png" alt="Kasinot.fi" height="32"></a> <a href="https://www.pelisivut.com"><img src="https://images.opencollective.com/pelisivut/04f08f2/logo.png" alt="Pelisivut" height="32"></a> <a href="https://www.nettikasinot.org"><img src="https://images.opencollective.com/nettikasinot-org/53a4b44/logo.png" alt="Nettikasinot.org" height="32"></a> <a href="https://www.bonus.com.de/freispiele"><img src="https://images.opencollective.com/bonusfinder-deutschland/646169e/logo.png" alt="BonusFinder Deutschland" height="32"></a> <a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/6e889f6/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/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.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a></p>
269
+ <p><a href="https://vpn-review.com/netflix-vpn"><img src="https://images.opencollective.com/vpn-for-netflix/4887627/logo.png" alt="vpn for netflix" height="32"></a> <a href="https://nettikasinolista.com"><img src="https://images.opencollective.com/nettikasinolista/fd361ee/logo.png" alt="Nettikasinolista.com" height="32"></a> <a href="https://www.veikkaajat.com"><img src="https://images.opencollective.com/veikkaajat/b92b427/logo.png" alt="Veikkaajat.com" height="32"></a> <a href="https://www.nettikasinot.media/"><img src="https://images.opencollective.com/nettikasinot-media/2dba7da/logo.png" alt="Nettikasinot.media" height="32"></a> <a href="https://mytruemedia.com/"><img src="https://images.opencollective.com/my-true-media/03e2168/logo.png" alt="My True Media" height="32"></a> <a href="https://www.norgekasino.com"><img src="https://images.opencollective.com/norgekasino/ecfd57a/logo.png" alt="Norgekasino" height="32"></a> <a href="https://www.japanesecasino.com/"><img src="https://images.opencollective.com/japanesecasino/b0ffe3c/logo.png" alt="Japanesecasino" height="32"></a> <a href="https://bruce.agency"><img src="https://images.opencollective.com/brucemade/0c70c59/logo.png" alt="Bruce" height="32"></a> <a href="https://www.casinotop.com/"><img src="https://images.opencollective.com/casinotop-com/10fd95b/logo.png" alt="CasinoTop.com" height="32"></a> <a href="https://www.casinotopp.net/"><img src="https://images.opencollective.com/casino-topp/1dd399a/logo.png" alt="Casino Topp" height="32"></a> <a href="https://writersperhour.com/write-my-essay"><img src="https://images.opencollective.com/writersperhour/5787d4b/logo.png" alt="Writers Per Hour" 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.kasinot.fi"><img src="https://images.opencollective.com/kasinot-fi/e09aa2e/logo.png" alt="Kasinot.fi" height="32"></a> <a href="https://www.pelisivut.com"><img src="https://images.opencollective.com/pelisivut/04f08f2/logo.png" alt="Pelisivut" height="32"></a> <a href="https://www.nettikasinot.org"><img src="https://images.opencollective.com/nettikasinot-org/53a4b44/logo.png" alt="Nettikasinot.org" height="32"></a> <a href="https://www.bonus.com.de/freispiele"><img src="https://images.opencollective.com/bonusfinder-deutschland/646169e/logo.png" alt="BonusFinder Deutschland" height="32"></a> <a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/6e889f6/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/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.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a></p>
260
270
  <!--sponsorsend-->
261
271
 
262
272
  ## <a name="technology-sponsors"></a>Technology Sponsors
@@ -124,8 +124,7 @@ module.exports = {
124
124
  }
125
125
  ]
126
126
  }
127
- ],
128
- additionalItems: false
127
+ ]
129
128
  },
130
129
 
131
130
  messages: {
@@ -1084,16 +1084,17 @@ module.exports = {
1084
1084
  },
1085
1085
 
1086
1086
  ArrowFunctionExpression(node) {
1087
- const firstToken = sourceCode.getFirstToken(node);
1087
+ const maybeOpeningParen = sourceCode.getFirstToken(node, { skip: node.async ? 1 : 0 });
1088
1088
 
1089
- if (astUtils.isOpeningParenToken(firstToken)) {
1090
- const openingParen = firstToken;
1089
+ if (astUtils.isOpeningParenToken(maybeOpeningParen)) {
1090
+ const openingParen = maybeOpeningParen;
1091
1091
  const closingParen = sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken);
1092
1092
 
1093
1093
  parameterParens.add(openingParen);
1094
1094
  parameterParens.add(closingParen);
1095
1095
  addElementListIndent(node.params, openingParen, closingParen, options.FunctionExpression.parameters);
1096
1096
  }
1097
+
1097
1098
  addBlocklessNodeIndent(node.body);
1098
1099
  },
1099
1100
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @fileoverview Rule to flag trailing underscores in variable declarations.
2
+ * @fileoverview Rule to flag dangling underscores in variable declarations.
3
3
  * @author Matt DuVall <http://www.mattduvall.com>
4
4
  */
5
5
 
@@ -45,6 +45,10 @@ module.exports = {
45
45
  enforceInMethodNames: {
46
46
  type: "boolean",
47
47
  default: false
48
+ },
49
+ allowFunctionParams: {
50
+ type: "boolean",
51
+ default: true
48
52
  }
49
53
  },
50
54
  additionalProperties: false
@@ -64,6 +68,7 @@ module.exports = {
64
68
  const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false;
65
69
  const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false;
66
70
  const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false;
71
+ const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true;
67
72
 
68
73
  //-------------------------------------------------------------------------
69
74
  // Helpers
@@ -80,12 +85,12 @@ module.exports = {
80
85
  }
81
86
 
82
87
  /**
83
- * Check if identifier has a underscore at the end
88
+ * Check if identifier has a dangling underscore
84
89
  * @param {string} identifier name of the node
85
90
  * @returns {boolean} true if its is present
86
91
  * @private
87
92
  */
88
- function hasTrailingUnderscore(identifier) {
93
+ function hasDanglingUnderscore(identifier) {
89
94
  const len = identifier.length;
90
95
 
91
96
  return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_");
@@ -126,16 +131,53 @@ module.exports = {
126
131
  }
127
132
 
128
133
  /**
129
- * Check if function has a underscore at the end
134
+ * Check if function parameter has a dangling underscore.
135
+ * @param {ASTNode} node function node to evaluate
136
+ * @returns {void}
137
+ * @private
138
+ */
139
+ function checkForDanglingUnderscoreInFunctionParameters(node) {
140
+ if (!allowFunctionParams) {
141
+ node.params.forEach(param => {
142
+ const { type } = param;
143
+ let nodeToCheck;
144
+
145
+ if (type === "RestElement") {
146
+ nodeToCheck = param.argument;
147
+ } else if (type === "AssignmentPattern") {
148
+ nodeToCheck = param.left;
149
+ } else {
150
+ nodeToCheck = param;
151
+ }
152
+
153
+ if (nodeToCheck.type === "Identifier") {
154
+ const identifier = nodeToCheck.name;
155
+
156
+ if (hasDanglingUnderscore(identifier) && !isAllowed(identifier)) {
157
+ context.report({
158
+ node: param,
159
+ messageId: "unexpectedUnderscore",
160
+ data: {
161
+ identifier
162
+ }
163
+ });
164
+ }
165
+ }
166
+ });
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Check if function has a dangling underscore
130
172
  * @param {ASTNode} node node to evaluate
131
173
  * @returns {void}
132
174
  * @private
133
175
  */
134
- function checkForTrailingUnderscoreInFunctionDeclaration(node) {
135
- if (node.id) {
176
+ function checkForDanglingUnderscoreInFunction(node) {
177
+ if (node.type === "FunctionDeclaration" && node.id) {
136
178
  const identifier = node.id.name;
137
179
 
138
- if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) {
180
+ if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) {
139
181
  context.report({
140
182
  node,
141
183
  messageId: "unexpectedUnderscore",
@@ -145,18 +187,19 @@ module.exports = {
145
187
  });
146
188
  }
147
189
  }
190
+ checkForDanglingUnderscoreInFunctionParameters(node);
148
191
  }
149
192
 
150
193
  /**
151
- * Check if variable expression has a underscore at the end
194
+ * Check if variable expression has a dangling underscore
152
195
  * @param {ASTNode} node node to evaluate
153
196
  * @returns {void}
154
197
  * @private
155
198
  */
156
- function checkForTrailingUnderscoreInVariableExpression(node) {
199
+ function checkForDanglingUnderscoreInVariableExpression(node) {
157
200
  const identifier = node.id.name;
158
201
 
159
- if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) &&
202
+ if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) &&
160
203
  !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) {
161
204
  context.report({
162
205
  node,
@@ -169,18 +212,18 @@ module.exports = {
169
212
  }
170
213
 
171
214
  /**
172
- * Check if member expression has a underscore at the end
215
+ * Check if member expression has a dangling underscore
173
216
  * @param {ASTNode} node node to evaluate
174
217
  * @returns {void}
175
218
  * @private
176
219
  */
177
- function checkForTrailingUnderscoreInMemberExpression(node) {
220
+ function checkForDanglingUnderscoreInMemberExpression(node) {
178
221
  const identifier = node.property.name,
179
222
  isMemberOfThis = node.object.type === "ThisExpression",
180
223
  isMemberOfSuper = node.object.type === "Super",
181
224
  isMemberOfThisConstructor = isThisConstructorReference(node);
182
225
 
183
- if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) &&
226
+ if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) &&
184
227
  !(isMemberOfThis && allowAfterThis) &&
185
228
  !(isMemberOfSuper && allowAfterSuper) &&
186
229
  !(isMemberOfThisConstructor && allowAfterThisConstructor) &&
@@ -196,16 +239,16 @@ module.exports = {
196
239
  }
197
240
 
198
241
  /**
199
- * Check if method declaration or method property has a underscore at the end
242
+ * Check if method declaration or method property has a dangling underscore
200
243
  * @param {ASTNode} node node to evaluate
201
244
  * @returns {void}
202
245
  * @private
203
246
  */
204
- function checkForTrailingUnderscoreInMethod(node) {
247
+ function checkForDanglingUnderscoreInMethod(node) {
205
248
  const identifier = node.key.name;
206
249
  const isMethod = node.type === "MethodDefinition" || node.type === "Property" && node.method;
207
250
 
208
- if (typeof identifier !== "undefined" && enforceInMethodNames && isMethod && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) {
251
+ if (typeof identifier !== "undefined" && enforceInMethodNames && isMethod && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) {
209
252
  context.report({
210
253
  node,
211
254
  messageId: "unexpectedUnderscore",
@@ -221,11 +264,13 @@ module.exports = {
221
264
  //--------------------------------------------------------------------------
222
265
 
223
266
  return {
224
- FunctionDeclaration: checkForTrailingUnderscoreInFunctionDeclaration,
225
- VariableDeclarator: checkForTrailingUnderscoreInVariableExpression,
226
- MemberExpression: checkForTrailingUnderscoreInMemberExpression,
227
- MethodDefinition: checkForTrailingUnderscoreInMethod,
228
- Property: checkForTrailingUnderscoreInMethod
267
+ FunctionDeclaration: checkForDanglingUnderscoreInFunction,
268
+ VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
269
+ MemberExpression: checkForDanglingUnderscoreInMemberExpression,
270
+ MethodDefinition: checkForDanglingUnderscoreInMethod,
271
+ Property: checkForDanglingUnderscoreInMethod,
272
+ FunctionExpression: checkForDanglingUnderscoreInFunction,
273
+ ArrowFunctionExpression: checkForDanglingUnderscoreInFunction
229
274
  };
230
275
 
231
276
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "7.6.0",
3
+ "version": "7.7.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {
@@ -111,7 +111,6 @@
111
111
  "karma-mocha": "^1.3.0",
112
112
  "karma-mocha-reporter": "^2.2.3",
113
113
  "karma-webpack": "^4.0.0-rc.6",
114
- "leche": "^2.2.3",
115
114
  "lint-staged": "^10.1.2",
116
115
  "load-perf": "^0.2.0",
117
116
  "markdownlint": "^0.19.0",