eslint 7.15.0 → 7.16.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,18 @@
1
+ v7.16.0 - December 18, 2020
2
+
3
+ * [`a62ad6f`](https://github.com/eslint/eslint/commit/a62ad6f03151358b93b5fede022a30d67310705c) Update: fix false negative of no-extra-parens with NewExpression (#13930) (Milos Djermanovic)
4
+ * [`f85b4c7`](https://github.com/eslint/eslint/commit/f85b4c72668c95c79fdb342b74dbd53d21baa93f) Fix: require-atomic-updates false positive across await (fixes #11954) (#13915) (buhi)
5
+ * [`301d0c0`](https://github.com/eslint/eslint/commit/301d0c05229dbd6cfb1045d716524e8ec46fa2c1) Fix: no-constant-condition false positives with unary expressions (#13927) (Milos Djermanovic)
6
+ * [`555c128`](https://github.com/eslint/eslint/commit/555c128b49ae6d9c100a9f8429416417edb40d13) Fix: false positive with await and ** in no-extra-parens (fixes #12739) (#13923) (Milos Djermanovic)
7
+ * [`d93c935`](https://github.com/eslint/eslint/commit/d93c9350361d2aa1a1976c553e47ab399e51e8c9) Docs: update JSON Schema links (#13936) (Milos Djermanovic)
8
+ * [`8d0c93a`](https://github.com/eslint/eslint/commit/8d0c93a7ef9449c7b7d082bbb4b7d8465b0d6bac) Upgrade: table@6.0.4 (#13920) (Rouven Weßling)
9
+ * [`9247683`](https://github.com/eslint/eslint/commit/924768377a4935a95a6ff3866f9545a5a6178b53) Docs: Remove for deleted npm run profile script (#13931) (Brandon Mills)
10
+ * [`ab240d4`](https://github.com/eslint/eslint/commit/ab240d49833b4e6e594667c1abe5b0caa8a9cf70) Fix: prefer-exponentiation-operator invalid autofix with await (#13924) (Milos Djermanovic)
11
+ * [`dc76911`](https://github.com/eslint/eslint/commit/dc7691103554a99bdb2142561cb507f50f547e3b) Chore: Add .pre-commit-hooks.yaml file (#13628) (Álvaro Mondéjar)
12
+ * [`2124e1b`](https://github.com/eslint/eslint/commit/2124e1b5dad30a905dc26bde9da472bf622d3f50) Docs: Fix wrong rule name (#13913) (noisyboy25)
13
+ * [`06b5809`](https://github.com/eslint/eslint/commit/06b58096975935ec016d96dd5f333f059c270f26) Sponsors: Sync README with website (ESLint Jenkins)
14
+ * [`26fc12f`](https://github.com/eslint/eslint/commit/26fc12f88109af9d4081bf0e16364c411bce3009) Docs: Update README team and sponsors (ESLint Jenkins)
15
+
1
16
  v7.15.0 - December 5, 2020
2
17
 
3
18
  * [`5c11aab`](https://github.com/eslint/eslint/commit/5c11aabbe8249aeb8cad29bc6a33fc20c8c683ef) Upgrade: @eslint/esintrc and espree for bug fixes (refs #13878) (#13908) (Brandon Mills)
package/README.md CHANGED
@@ -207,11 +207,6 @@ Brandon Mills
207
207
  Toru Nagashima
208
208
  </a>
209
209
  </td><td align="center" valign="top" width="11%">
210
- <a href="https://github.com/kaicataldo">
211
- <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
212
- Kai Cataldo
213
- </a>
214
- </td><td align="center" valign="top" width="11%">
215
210
  <a href="https://github.com/mdjermanovic">
216
211
  <img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
217
212
  Milos Djermanovic
@@ -267,7 +262,7 @@ The following companies, organizations, and individuals support ESLint's ongoing
267
262
  <p><a href="https://automattic.com"><img src="https://images.opencollective.com/photomatt/ff91f0b/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
268
263
  <p><a href="https://google.com/chrome"><img src="https://images.opencollective.com/chrome/dc55bd4/logo.png" alt="Chrome's Web Framework & Tools Performance Fund" height="96"></a> <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>
269
264
  <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>
270
- <p><a href="https://writersperhour.com"><img src="https://images.opencollective.com/writersperhour/5787d4b/logo.png" alt="Writers Per Hour" height="32"></a> <a href="https://www.betacalendars.com/printable-calendar"><img src="https://images.opencollective.com/betacalendars/9334b33/logo.png" alt="2021 calendar" height="32"></a> <a href="https://buy.fineproxy.org/eng/"><img src="https://images.opencollective.com/buy-fineproxy-org/b282e39/logo.png" alt="Buy.Fineproxy.Org" 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.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="null"><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/7fa1641/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.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a></p>
265
+ <p><a href="https://writersperhour.com"><img src="https://images.opencollective.com/writersperhour/5787d4b/logo.png" alt="Writers Per Hour" height="32"></a> <a href="https://www.betacalendars.com/printable-calendar"><img src="https://images.opencollective.com/betacalendars/9334b33/logo.png" alt="2021 calendar" height="32"></a> <a href="https://buy.fineproxy.org/eng/"><img src="https://images.opencollective.com/buy-fineproxy-org/b282e39/logo.png" alt="Buy.Fineproxy.Org" height="32"></a> <a href="https://www.veikkaajat.com"><img src="https://images.opencollective.com/veikkaajat/3777f94/logo.png" alt="Veikkaajat.com" 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="null"><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/7fa1641/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.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a></p>
271
266
  <!--sponsorsend-->
272
267
 
273
268
  ## <a name="technology-sponsors"></a>Technology Sponsors
@@ -147,12 +147,18 @@ module.exports = {
147
147
  }
148
148
 
149
149
  case "UnaryExpression":
150
- if (node.operator === "void") {
150
+ if (
151
+ node.operator === "void" ||
152
+ node.operator === "typeof" && inBooleanPosition
153
+ ) {
151
154
  return true;
152
155
  }
153
156
 
154
- return (node.operator === "typeof" && inBooleanPosition) ||
155
- isConstant(node.argument, true);
157
+ if (node.operator === "!") {
158
+ return isConstant(node.argument, true);
159
+ }
160
+
161
+ return isConstant(node.argument, false);
156
162
 
157
163
  case "BinaryExpression":
158
164
  return isConstant(node.left, false) &&
@@ -472,20 +472,34 @@ module.exports = {
472
472
  const callee = node.callee;
473
473
 
474
474
  if (hasExcessParensWithPrecedence(callee, precedence(node))) {
475
- const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee);
476
-
477
475
  if (
478
476
  hasDoubleExcessParens(callee) ||
479
- !isIIFE(node) &&
480
- !hasNewParensException &&
481
477
  !(
482
-
483
- // Allow extra parens around a new expression if they are intervening parentheses.
484
- node.type === "NewExpression" &&
485
- callee.type === "MemberExpression" &&
486
- doesMemberExpressionContainCallExpression(callee)
487
- ) &&
488
- !(!node.optional && callee.type === "ChainExpression")
478
+ isIIFE(node) ||
479
+
480
+ // (new A)(); new (new A)();
481
+ (
482
+ callee.type === "NewExpression" &&
483
+ !isNewExpressionWithParens(callee) &&
484
+ !(
485
+ node.type === "NewExpression" &&
486
+ !isNewExpressionWithParens(node)
487
+ )
488
+ ) ||
489
+
490
+ // new (a().b)(); new (a.b().c);
491
+ (
492
+ node.type === "NewExpression" &&
493
+ callee.type === "MemberExpression" &&
494
+ doesMemberExpressionContainCallExpression(callee)
495
+ ) ||
496
+
497
+ // (a?.b)(); (a?.())();
498
+ (
499
+ !node.optional &&
500
+ callee.type === "ChainExpression"
501
+ )
502
+ )
489
503
  ) {
490
504
  report(node.callee);
491
505
  }
@@ -511,7 +525,7 @@ module.exports = {
511
525
 
512
526
  if (!shouldSkipLeft && hasExcessParens(node.left)) {
513
527
  if (
514
- !(node.left.type === "UnaryExpression" && isExponentiation) &&
528
+ !(["AwaitExpression", "UnaryExpression"].includes(node.left.type) && isExponentiation) &&
515
529
  !astUtils.isMixedLogicalAndCoalesceExpressions(node.left, node) &&
516
530
  (leftPrecedence > prec || (leftPrecedence === prec && !isExponentiation)) ||
517
531
  isParenthesisedTwice(node.left)
@@ -30,6 +30,7 @@ function doesBaseNeedParens(base) {
30
30
  astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR ||
31
31
 
32
32
  // An unary operator cannot be used immediately before an exponentiation expression
33
+ base.type === "AwaitExpression" ||
33
34
  base.type === "UnaryExpression"
34
35
  );
35
36
  }
@@ -113,6 +113,9 @@ class SegmentInfo {
113
113
 
114
114
  if (info) {
115
115
  info.freshReadVariableNames.add(variableName);
116
+
117
+ // If a variable is freshly read again, then it's no more out-dated.
118
+ info.outdatedReadVariableNames.delete(variableName);
116
119
  }
117
120
  }
118
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "7.15.0",
3
+ "version": "7.16.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {
@@ -80,7 +80,7 @@
80
80
  "semver": "^7.2.1",
81
81
  "strip-ansi": "^6.0.0",
82
82
  "strip-json-comments": "^3.1.0",
83
- "table": "^5.2.3",
83
+ "table": "^6.0.4",
84
84
  "text-table": "^0.2.0",
85
85
  "v8-compile-cache": "^2.0.3"
86
86
  },