eslint 7.6.0 → 7.9.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 +72 -0
- package/README.md +25 -15
- package/conf/config-schema.js +12 -0
- package/lib/cli-engine/cascading-config-array-factory.js +12 -0
- package/lib/cli-engine/cli-engine.js +2 -2
- package/lib/cli-engine/config-array/config-array.js +12 -0
- package/lib/cli-engine/config-array/config-dependency.js +12 -0
- package/lib/cli-engine/config-array/extracted-config.js +12 -0
- package/lib/cli-engine/config-array/ignore-pattern.js +12 -0
- package/lib/cli-engine/config-array/index.js +12 -0
- package/lib/cli-engine/config-array/override-tester.js +12 -0
- package/lib/cli-engine/config-array-factory.js +24 -6
- package/lib/eslint/eslint.js +7 -1
- package/lib/init/autoconfig.js +1 -1
- package/lib/init/config-initializer.js +3 -3
- package/lib/linter/code-path-analysis/code-path-analyzer.js +38 -0
- package/lib/linter/code-path-analysis/code-path-state.js +2 -2
- package/lib/linter/config-comment-parser.js +1 -1
- package/lib/linter/linter.js +6 -3
- package/lib/rules/comma-dangle.js +1 -2
- package/lib/rules/constructor-super.js +17 -1
- package/lib/rules/id-length.js +20 -7
- package/lib/rules/indent.js +4 -3
- package/lib/rules/no-loss-of-precision.js +10 -2
- package/lib/rules/no-magic-numbers.js +20 -3
- package/lib/rules/no-underscore-dangle.js +66 -21
- package/lib/rules/no-warning-comments.js +40 -7
- package/lib/rules/operator-assignment.js +1 -1
- package/lib/rules/prefer-destructuring.js +5 -0
- package/lib/rules/prefer-numeric-literals.js +10 -0
- package/lib/rules/utils/ast-utils.js +49 -13
- package/lib/shared/config-validator.js +14 -2
- package/lib/shared/relative-module-resolver.js +12 -0
- package/lib/shared/types.js +1 -1
- package/messages/plugin-invalid.txt +8 -0
- package/package.json +3 -3
- package/conf/environments.js +0 -168
- package/lib/shared/config-ops.js +0 -130
- package/lib/shared/naming.js +0 -97
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,75 @@
|
|
1
|
+
v7.9.0 - September 12, 2020
|
2
|
+
|
3
|
+
* [`3ca2700`](https://github.com/eslint/eslint/commit/3ca27004ece5016ba7aed775f01ad13bc9282296) Fix: Corrected notice for invalid (:) plugin names (#13473) (Josh Goldberg)
|
4
|
+
* [`fc5783d`](https://github.com/eslint/eslint/commit/fc5783d2ff9e3b0d7a1f9664928d49270b4a6c01) Docs: Fix leaky anchors in v4 migration page (#13635) (Timo Tijhof)
|
5
|
+
* [`f1d07f1`](https://github.com/eslint/eslint/commit/f1d07f112be96c64dfdaa154aa9ac81985b16238) Docs: Provide install commands for Yarn (#13661) (Nikita Baksalyar)
|
6
|
+
* [`29d1cdc`](https://github.com/eslint/eslint/commit/29d1cdceedd6c056a39149723cf9ff2fbb260cbf) Fix: prefer-destructuring removes comments (refs #13678) (#13682) (Milos Djermanovic)
|
7
|
+
* [`b4da0a7`](https://github.com/eslint/eslint/commit/b4da0a7ca7995435bdfc116fd374eb0649470131) Docs: fix typo in working with plugins docs (#13683) (啸生)
|
8
|
+
* [`6f87db7`](https://github.com/eslint/eslint/commit/6f87db7c318225e48ccbbf0bec8b3758ea839b82) Update: fix id-length false negatives on Object.prototype property names (#13670) (Milos Djermanovic)
|
9
|
+
* [`361ac4d`](https://github.com/eslint/eslint/commit/361ac4d895c15086fb4351d4dca1405b2fdc4bd5) Fix: NonOctalDecimalIntegerLiteral is decimal integer (fixes #13588) (#13664) (Milos Djermanovic)
|
10
|
+
* [`f260716`](https://github.com/eslint/eslint/commit/f260716695064e4b4193337107b60401bd4b3f20) Docs: update outdated link (#13677) (klkhan)
|
11
|
+
* [`5138c91`](https://github.com/eslint/eslint/commit/5138c913c256e4266ffb68278783af45bf70af84) Docs: add missing eslint directive comments in no-await-in-loop (#13673) (Milos Djermanovic)
|
12
|
+
* [`17b58b5`](https://github.com/eslint/eslint/commit/17b58b528df62bf96813d50c087cafdf83306810) Docs: clarify correct example in no-return-await (fixes #13656) (#13657) (Milos Djermanovic)
|
13
|
+
* [`9171f0a`](https://github.com/eslint/eslint/commit/9171f0a99bb4d7c53f109b1c2b215004a7c27713) Chore: fix typo (#13660) (Nitin Kumar)
|
14
|
+
* [`6d9f8fb`](https://github.com/eslint/eslint/commit/6d9f8fbb7ed4361b475fb50d04e6d25744d5b1a2) Sponsors: Sync README with website (ESLint Jenkins)
|
15
|
+
* [`97b0dd9`](https://github.com/eslint/eslint/commit/97b0dd9a1af1ae4ae3857adcfe6eeac7837101ed) Sponsors: Sync README with website (ESLint Jenkins)
|
16
|
+
* [`deab125`](https://github.com/eslint/eslint/commit/deab125fc9220dab43baeb32c6cf78942ad25a83) Sponsors: Sync README with website (ESLint Jenkins)
|
17
|
+
* [`bf2e367`](https://github.com/eslint/eslint/commit/bf2e367bf4f6fde9930af9de8b8d8bc3d8b5782f) Sponsors: Sync README with website (ESLint Jenkins)
|
18
|
+
* [`8929208`](https://github.com/eslint/eslint/commit/89292084bf91ba5ae5bf966c6c56fa3da139ce57) Sponsors: Sync README with website (ESLint Jenkins)
|
19
|
+
|
20
|
+
v7.8.1 - September 1, 2020
|
21
|
+
|
22
|
+
* [`f542b5d`](https://github.com/eslint/eslint/commit/f542b5d0679b73326ad249fc44a54c3f848bd3e6) Fix: Update broken @eslint/eslintrc version (fixes #13641) (#13647) (Nicholas C. Zakas)
|
23
|
+
* [`c1b5696`](https://github.com/eslint/eslint/commit/c1b56966c2354e12d16e8394443de49fa54f4290) Sponsors: Sync README with website (ESLint Jenkins)
|
24
|
+
* [`8ddeda0`](https://github.com/eslint/eslint/commit/8ddeda01afdb1e9656a43853b8e25c9c4582e6ad) Sponsors: Sync README with website (ESLint Jenkins)
|
25
|
+
* [`e02e2fe`](https://github.com/eslint/eslint/commit/e02e2fe019a1ed9a34a7b96e4c8961c35093b0ce) Sponsors: Sync README with website (ESLint Jenkins)
|
26
|
+
|
27
|
+
v7.8.0 - August 31, 2020
|
28
|
+
|
29
|
+
* [`58abd93`](https://github.com/eslint/eslint/commit/58abd9311900a8af5a3c0963daaf64675bdd8383) Update: support logical assignments in code path analysis (refs #13569) (#13612) (Milos Djermanovic)
|
30
|
+
* [`db7488e`](https://github.com/eslint/eslint/commit/db7488e6326fd1b7ea04c5062beb1c5f75fc15ed) Update: support logical assignments in core rules (refs #13569) (#13618) (Milos Djermanovic)
|
31
|
+
* [`3729219`](https://github.com/eslint/eslint/commit/372921924778f2e525535985e17c97b988546210) Docs: Update Step 1 of Development Environment documentation (klkhan)
|
32
|
+
* [`a320324`](https://github.com/eslint/eslint/commit/a32032430a0779a4e3b2d137d4d0682844084b82) Chore: Test formatted integers in no-dupe-keys (refs #13568) (#13626) (Brandon Mills)
|
33
|
+
* [`88a9ade`](https://github.com/eslint/eslint/commit/88a9ade7643bb166efbab45cee15f3269496f4be) Update: add es2021 environment (refs #13602) (#13603) (Milos Djermanovic)
|
34
|
+
* [`0003dc0`](https://github.com/eslint/eslint/commit/0003dc0f966f2b47555595586f84eb3163cb0179) Update: support numeric separators (refs #13568) (#13581) (Milos Djermanovic)
|
35
|
+
* [`96b11a0`](https://github.com/eslint/eslint/commit/96b11a0717bf32b94ec768611574372320fb774b) Update: Add exceptionPatterns to id-length rule (fixes #13094) (#13576) (sodam)
|
36
|
+
* [`3439fea`](https://github.com/eslint/eslint/commit/3439fea5c0ed330d01d874b0c9df51dd51ae792c) Update: support numeric-separator in no-loss-of-precision (refs #13568) (#13574) (Anix)
|
37
|
+
* [`ed64767`](https://github.com/eslint/eslint/commit/ed64767859d776145d68145419a61f5379b4dd63) Update: add comment to message in no-warning-comments (fixes #12327) (#13522) (Anix)
|
38
|
+
* [`e60ec07`](https://github.com/eslint/eslint/commit/e60ec07fad0c1d4c966f28d214c5379da753ff4e) Sponsors: Sync README with website (ESLint Jenkins)
|
39
|
+
* [`483bf7f`](https://github.com/eslint/eslint/commit/483bf7f3cc40e0d866798d6ca9ee1c19aa77ddd2) Docs: fix examples in object-curly-newline (#13605) (Soobin Bak)
|
40
|
+
* [`1c35d57`](https://github.com/eslint/eslint/commit/1c35d57b0a5f374cc55f1727a7561bcab1962e83) Docs: Remove stale Keybase 2FA instructions (#13622) (Brandon Mills)
|
41
|
+
* [`82669fa`](https://github.com/eslint/eslint/commit/82669fa66670a00988db5b1d10fe8f3bf30be84e) Chore: Extract some functionality to eslintrc (refs #13481) (#13613) (Nicholas C. Zakas)
|
42
|
+
* [`4111d21`](https://github.com/eslint/eslint/commit/4111d21a046b73892e2c84f92815a21ef4db63e1) Docs: Fix typo and missing article before noun in docs (#13611) (Patrice Sandhu)
|
43
|
+
* [`091e52a`](https://github.com/eslint/eslint/commit/091e52ae1ca408f3e668f394c14d214c9ce806e6) Upgrade: espree@7.3.0 (refs #13568) (#13609) (Kai Cataldo)
|
44
|
+
* [`05074fb`](https://github.com/eslint/eslint/commit/05074fb2c243e904e8c09d714ad9d084acdd80d2) Sponsors: Sync README with website (ESLint Jenkins)
|
45
|
+
* [`bdb65ec`](https://github.com/eslint/eslint/commit/bdb65ec2e672c9815bee356b61d1cd60a1072152) Chore: add 3rd party parsers in BUG_REPORT template (#13606) (YeonJuan)
|
46
|
+
* [`f954476`](https://github.com/eslint/eslint/commit/f954476fb6b0664679c73babd5e8a0647572b81f) Chore: add common 3rd party parsers to issue template (#13596) (Kai Cataldo)
|
47
|
+
* [`2bee6d2`](https://github.com/eslint/eslint/commit/2bee6d256ae0516c9a9003bb3fdca24ff93253b5) Chore: Mark config-related files (refs #13481) (#13597) (Nicholas C. Zakas)
|
48
|
+
* [`66442a9`](https://github.com/eslint/eslint/commit/66442a9faf9872db4a40f56dde28c48f4d02fc7b) Update: Add no-magic-numbers 'ignoreDefaultValues' option (#12611) (Dieter Luypaert)
|
49
|
+
* [`b487164`](https://github.com/eslint/eslint/commit/b487164d01dd0bf66fdf2df0e374ce1c3bdb0339) Docs: add exponentiation operators to operator-assignment documentation (#13577) (Milos Djermanovic)
|
50
|
+
* [`2f27836`](https://github.com/eslint/eslint/commit/2f27836e989f3dfe236e34054b490febc359bc48) Sponsors: Sync README with website (ESLint Jenkins)
|
51
|
+
* [`60eafc1`](https://github.com/eslint/eslint/commit/60eafc15075f38955cb6816bf1f0bcf6e6e6d3a6) Sponsors: Sync README with website (ESLint Jenkins)
|
52
|
+
|
53
|
+
v7.7.0 - August 14, 2020
|
54
|
+
|
55
|
+
* [`b46f3ee`](https://github.com/eslint/eslint/commit/b46f3ee0dae4add9df99cae940b641ad8de58b9e) Update: allowFunctionParams option in no-underscore-dangle (fixes 12579) (#13545) (Sunghyun Cho)
|
56
|
+
* [`26aa245`](https://github.com/eslint/eslint/commit/26aa2452b5f407fabc25dad21182180e4d3be532) Docs: clarify "case" specifier in padding-line-between-statements (#13562) (Milos Djermanovic)
|
57
|
+
* [`082891c`](https://github.com/eslint/eslint/commit/082891c042d72953fe86cd3ce9c96e661760793d) Docs: Update semantic versioning policy (#13563) (Nicholas C. Zakas)
|
58
|
+
* [`4e0b672`](https://github.com/eslint/eslint/commit/4e0b672eb4bf39f7502a550b08b25a56a196f19f) Fix: revert "Update: disallow multiple options in comma-dangle schema" (#13564) (Kai Cataldo)
|
59
|
+
* [`254990e`](https://github.com/eslint/eslint/commit/254990e87914457ca25ea2d7ee012964e56fc9e5) Fix: indent for async arrow functions (fixes #13497) (#13544) (Anix)
|
60
|
+
* [`28ca339`](https://github.com/eslint/eslint/commit/28ca339259b07c96c73f2ef28cbf112b96395855) Sponsors: Sync README with website (ESLint Jenkins)
|
61
|
+
* [`2e4158d`](https://github.com/eslint/eslint/commit/2e4158d3ec9cfed6400bf70795fd7171e96ff9b3) Sponsors: Sync README with website (ESLint Jenkins)
|
62
|
+
* [`488d159`](https://github.com/eslint/eslint/commit/488d1595aef43c4d52cccdb2c97977884f0375a8) Sponsors: Sync README with website (ESLint Jenkins)
|
63
|
+
* [`c44306e`](https://github.com/eslint/eslint/commit/c44306e52778309a79232ceab8b55a9aa0f2dfda) Sponsors: Sync README with website (ESLint Jenkins)
|
64
|
+
* [`6677180`](https://github.com/eslint/eslint/commit/6677180495e16a02d150d0552e7e5d5f6b77fcc5) Sponsors: Sync README with website (ESLint Jenkins)
|
65
|
+
* [`07db7b8`](https://github.com/eslint/eslint/commit/07db7b8080c2f68ee28e7d447db356c33e6fddce) Sponsors: Sync README with website (ESLint Jenkins)
|
66
|
+
* [`d4ce4d3`](https://github.com/eslint/eslint/commit/d4ce4d3b8492c3e4654ed1f51f2c48e6c0ad272f) Sponsors: Sync README with website (ESLint Jenkins)
|
67
|
+
* [`284e954`](https://github.com/eslint/eslint/commit/284e954f93126c50e0aa9b88f42afb03a47ad967) Sponsors: Sync README with website (ESLint Jenkins)
|
68
|
+
* [`ae9b54e`](https://github.com/eslint/eslint/commit/ae9b54e59b01aa9f50ee31f5b6787d86e6b59de6) Sponsors: Sync README with website (ESLint Jenkins)
|
69
|
+
* [`9124a15`](https://github.com/eslint/eslint/commit/9124a1599638a1caf4b7e252d1cb66abdc5e51c6) Chore: remove leche (fixes #13287) (#13533) (Mark de Dios)
|
70
|
+
* [`5c4c7f5`](https://github.com/eslint/eslint/commit/5c4c7f515c2e8e83f2186a66ddce75d6477abeb0) Sponsors: Sync README with website (ESLint Jenkins)
|
71
|
+
* [`48d8ec8`](https://github.com/eslint/eslint/commit/48d8ec8cf320c69aed17c6b6c78f19e7c1e587ca) Sponsors: Sync README with website (ESLint Jenkins)
|
72
|
+
|
1
73
|
v7.6.0 - July 31, 2020
|
2
74
|
|
3
75
|
* [`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.
|
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://
|
269
|
+
<p><a href="https://buy.fineproxy.org/eng/"><img src="https://images.opencollective.com/buy-fineproxy-org/2002c40/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.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://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://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="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.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" 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>
|
260
270
|
<!--sponsorsend-->
|
261
271
|
|
262
272
|
## <a name="technology-sponsors"></a>Technology Sponsors
|
package/conf/config-schema.js
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview Defines a schema for configs.
|
3
15
|
* @author Sylvan Mably
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `CascadingConfigArrayFactory` class.
|
3
15
|
*
|
@@ -19,8 +19,8 @@ const fs = require("fs");
|
|
19
19
|
const path = require("path");
|
20
20
|
const defaultOptions = require("../../conf/default-cli-options");
|
21
21
|
const pkg = require("../../package.json");
|
22
|
-
const ConfigOps = require("
|
23
|
-
const naming = require("
|
22
|
+
const ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops");
|
23
|
+
const naming = require("@eslint/eslintrc/lib/shared/naming");
|
24
24
|
const ModuleResolver = require("../shared/relative-module-resolver");
|
25
25
|
const { Linter } = require("../linter");
|
26
26
|
const builtInRules = require("../rules");
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `ConfigArray` class.
|
3
15
|
*
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `ConfigDependency` class.
|
3
15
|
*
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `ExtractedConfig` class.
|
3
15
|
*
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `IgnorePattern` class.
|
3
15
|
*
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `ConfigArray` class.
|
3
15
|
* @author Toru Nagashima <https://github.com/mysticatea>
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview `OverrideTester` class.
|
3
15
|
*
|
@@ -1,3 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* STOP!!! DO NOT MODIFY.
|
3
|
+
*
|
4
|
+
* This file is part of the ongoing work to move the eslintrc-style config
|
5
|
+
* system into the @eslint/eslintrc package. This file needs to remain
|
6
|
+
* unchanged in order for this work to proceed.
|
7
|
+
*
|
8
|
+
* If you think you need to change this file, please contact @nzakas first.
|
9
|
+
*
|
10
|
+
* Thanks in advance for your cooperation.
|
11
|
+
*/
|
12
|
+
|
1
13
|
/**
|
2
14
|
* @fileoverview The factory of `ConfigArray` objects.
|
3
15
|
*
|
@@ -44,7 +56,7 @@ const path = require("path");
|
|
44
56
|
const importFresh = require("import-fresh");
|
45
57
|
const stripComments = require("strip-json-comments");
|
46
58
|
const { validateConfigSchema } = require("../shared/config-validator");
|
47
|
-
const naming = require("
|
59
|
+
const naming = require("@eslint/eslintrc/lib/shared/naming");
|
48
60
|
const ModuleResolver = require("../shared/relative-module-resolver");
|
49
61
|
const {
|
50
62
|
ConfigArray,
|
@@ -274,14 +286,15 @@ function loadESLintIgnoreFile(filePath) {
|
|
274
286
|
* Creates an error to notify about a missing config to extend from.
|
275
287
|
* @param {string} configName The name of the missing config.
|
276
288
|
* @param {string} importerName The name of the config that imported the missing config
|
289
|
+
* @param {string} messageTemplate The text template to source error strings from.
|
277
290
|
* @returns {Error} The error object to throw
|
278
291
|
* @private
|
279
292
|
*/
|
280
|
-
function
|
293
|
+
function configInvalidError(configName, importerName, messageTemplate) {
|
281
294
|
return Object.assign(
|
282
295
|
new Error(`Failed to load config "${configName}" to extend from.`),
|
283
296
|
{
|
284
|
-
messageTemplate
|
297
|
+
messageTemplate,
|
285
298
|
messageData: { configName, importerName }
|
286
299
|
}
|
287
300
|
);
|
@@ -790,7 +803,7 @@ class ConfigArrayFactory {
|
|
790
803
|
});
|
791
804
|
}
|
792
805
|
|
793
|
-
throw
|
806
|
+
throw configInvalidError(extendName, ctx.name, "extend-config-missing");
|
794
807
|
}
|
795
808
|
|
796
809
|
/**
|
@@ -802,6 +815,11 @@ class ConfigArrayFactory {
|
|
802
815
|
*/
|
803
816
|
_loadExtendedPluginConfig(extendName, ctx) {
|
804
817
|
const slashIndex = extendName.lastIndexOf("/");
|
818
|
+
|
819
|
+
if (slashIndex === -1) {
|
820
|
+
throw configInvalidError(extendName, ctx.filePath, "plugin-invalid");
|
821
|
+
}
|
822
|
+
|
805
823
|
const pluginName = extendName.slice("plugin:".length, slashIndex);
|
806
824
|
const configName = extendName.slice(slashIndex + 1);
|
807
825
|
|
@@ -822,7 +840,7 @@ class ConfigArrayFactory {
|
|
822
840
|
});
|
823
841
|
}
|
824
842
|
|
825
|
-
throw plugin.error ||
|
843
|
+
throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing");
|
826
844
|
}
|
827
845
|
|
828
846
|
/**
|
@@ -855,7 +873,7 @@ class ConfigArrayFactory {
|
|
855
873
|
} catch (error) {
|
856
874
|
/* istanbul ignore else */
|
857
875
|
if (error && error.code === "MODULE_NOT_FOUND") {
|
858
|
-
throw
|
876
|
+
throw configInvalidError(extendName, ctx.filePath, "extend-config-missing");
|
859
877
|
}
|
860
878
|
throw error;
|
861
879
|
}
|
package/lib/eslint/eslint.js
CHANGED
@@ -15,7 +15,13 @@ const fs = require("fs");
|
|
15
15
|
const { promisify } = require("util");
|
16
16
|
const { CLIEngine, getCLIEngineInternalSlots } = require("../cli-engine/cli-engine");
|
17
17
|
const BuiltinRules = require("../rules");
|
18
|
-
const {
|
18
|
+
const {
|
19
|
+
Legacy: {
|
20
|
+
ConfigOps: {
|
21
|
+
getRuleSeverity
|
22
|
+
}
|
23
|
+
}
|
24
|
+
} = require("@eslint/eslintrc");
|
19
25
|
const { version } = require("../../package.json");
|
20
26
|
|
21
27
|
//------------------------------------------------------------------------------
|
package/lib/init/autoconfig.js
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
const lodash = require("lodash"),
|
13
13
|
recConfig = require("../../conf/eslint-recommended"),
|
14
|
-
ConfigOps = require("
|
14
|
+
ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"),
|
15
15
|
{ Linter } = require("../linter"),
|
16
16
|
configRule = require("./config-rule");
|
17
17
|
|
@@ -17,9 +17,9 @@ const util = require("util"),
|
|
17
17
|
semver = require("semver"),
|
18
18
|
espree = require("espree"),
|
19
19
|
recConfig = require("../../conf/eslint-recommended"),
|
20
|
-
ConfigOps = require("
|
20
|
+
ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"),
|
21
21
|
log = require("../shared/logging"),
|
22
|
-
naming = require("
|
22
|
+
naming = require("@eslint/eslintrc/lib/shared/naming"),
|
23
23
|
ModuleResolver = require("../shared/relative-module-resolver"),
|
24
24
|
autoconfig = require("./autoconfig.js"),
|
25
25
|
ConfigFile = require("./config-file"),
|
@@ -265,7 +265,7 @@ function processAnswers(answers) {
|
|
265
265
|
};
|
266
266
|
|
267
267
|
config.parserOptions.ecmaVersion = espree.latestEcmaVersion;
|
268
|
-
config.env.
|
268
|
+
config.env.es2021 = true;
|
269
269
|
|
270
270
|
// set the module type
|
271
271
|
if (answers.moduleType === "esm") {
|
@@ -39,6 +39,17 @@ function isHandledLogicalOperator(operator) {
|
|
39
39
|
return operator === "&&" || operator === "||" || operator === "??";
|
40
40
|
}
|
41
41
|
|
42
|
+
/**
|
43
|
+
* Checks whether the given assignment operator is a logical assignment operator.
|
44
|
+
* Logical assignments are taken into account for the code path analysis
|
45
|
+
* because of their short-circuiting semantics.
|
46
|
+
* @param {string} operator The operator found in the AssignmentExpression node
|
47
|
+
* @returns {boolean} `true` if the operator is "&&=" or "||=" or "??="
|
48
|
+
*/
|
49
|
+
function isLogicalAssignmentOperator(operator) {
|
50
|
+
return operator === "&&=" || operator === "||=" || operator === "??=";
|
51
|
+
}
|
52
|
+
|
42
53
|
/**
|
43
54
|
* Gets the label if the parent node of a given node is a LabeledStatement.
|
44
55
|
* @param {ASTNode} node A node to get.
|
@@ -71,6 +82,9 @@ function isForkingByTrueOrFalse(node) {
|
|
71
82
|
case "LogicalExpression":
|
72
83
|
return isHandledLogicalOperator(parent.operator);
|
73
84
|
|
85
|
+
case "AssignmentExpression":
|
86
|
+
return isLogicalAssignmentOperator(parent.operator);
|
87
|
+
|
74
88
|
default:
|
75
89
|
return false;
|
76
90
|
}
|
@@ -266,6 +280,15 @@ function preprocess(analyzer, node) {
|
|
266
280
|
}
|
267
281
|
break;
|
268
282
|
|
283
|
+
case "AssignmentExpression":
|
284
|
+
if (
|
285
|
+
parent.right === node &&
|
286
|
+
isLogicalAssignmentOperator(parent.operator)
|
287
|
+
) {
|
288
|
+
state.makeLogicalRight();
|
289
|
+
}
|
290
|
+
break;
|
291
|
+
|
269
292
|
case "ConditionalExpression":
|
270
293
|
case "IfStatement":
|
271
294
|
|
@@ -413,6 +436,15 @@ function processCodePathToEnter(analyzer, node) {
|
|
413
436
|
}
|
414
437
|
break;
|
415
438
|
|
439
|
+
case "AssignmentExpression":
|
440
|
+
if (isLogicalAssignmentOperator(node.operator)) {
|
441
|
+
state.pushChoiceContext(
|
442
|
+
node.operator.slice(0, -1), // removes `=` from the end
|
443
|
+
isForkingByTrueOrFalse(node)
|
444
|
+
);
|
445
|
+
}
|
446
|
+
break;
|
447
|
+
|
416
448
|
case "ConditionalExpression":
|
417
449
|
case "IfStatement":
|
418
450
|
state.pushChoiceContext("test", false);
|
@@ -491,6 +523,12 @@ function processCodePathToExit(analyzer, node) {
|
|
491
523
|
}
|
492
524
|
break;
|
493
525
|
|
526
|
+
case "AssignmentExpression":
|
527
|
+
if (isLogicalAssignmentOperator(node.operator)) {
|
528
|
+
state.popChoiceContext();
|
529
|
+
}
|
530
|
+
break;
|
531
|
+
|
494
532
|
case "SwitchStatement":
|
495
533
|
state.popSwitchContext();
|
496
534
|
break;
|
@@ -317,7 +317,7 @@ class CodePathState {
|
|
317
317
|
//--------------------------------------------------------------------------
|
318
318
|
|
319
319
|
/**
|
320
|
-
* Creates a context for ConditionalExpression, LogicalExpression,
|
320
|
+
* Creates a context for ConditionalExpression, LogicalExpression, AssignmentExpression (logical assignments only),
|
321
321
|
* IfStatement, WhileStatement, DoWhileStatement, or ForStatement.
|
322
322
|
*
|
323
323
|
* LogicalExpressions have cases that it goes different paths between the
|
@@ -339,7 +339,7 @@ class CodePathState {
|
|
339
339
|
* a -> b -> foo();
|
340
340
|
* a -> b -> bar();
|
341
341
|
* @param {string} kind A kind string.
|
342
|
-
* If the new context is LogicalExpression's, this is `"&&"` or `"||"`.
|
342
|
+
* If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`.
|
343
343
|
* If it's IfStatement's or ConditionalExpression's, this is `"test"`.
|
344
344
|
* Otherwise, this is `"loop"`.
|
345
345
|
* @param {boolean} isForkingAsResult A flag that shows that goes different
|
@@ -11,7 +11,7 @@
|
|
11
11
|
//------------------------------------------------------------------------------
|
12
12
|
|
13
13
|
const levn = require("levn"),
|
14
|
-
ConfigOps = require("
|
14
|
+
ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops");
|
15
15
|
|
16
16
|
const debug = require("debug")("eslint:config-comment-parser");
|
17
17
|
|
package/lib/linter/linter.js
CHANGED
@@ -16,11 +16,11 @@ const
|
|
16
16
|
evk = require("eslint-visitor-keys"),
|
17
17
|
espree = require("espree"),
|
18
18
|
lodash = require("lodash"),
|
19
|
-
BuiltInEnvironments = require("
|
19
|
+
BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"),
|
20
20
|
pkg = require("../../package.json"),
|
21
21
|
astUtils = require("../shared/ast-utils"),
|
22
|
-
ConfigOps = require("
|
23
|
-
|
22
|
+
ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"),
|
23
|
+
ConfigValidator = require("@eslint/eslintrc/lib/shared/config-validator"),
|
24
24
|
Traverser = require("../shared/traverser"),
|
25
25
|
{ SourceCode } = require("../source-code"),
|
26
26
|
CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"),
|
@@ -293,6 +293,9 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
|
|
293
293
|
const exportedVariables = {};
|
294
294
|
const problems = [];
|
295
295
|
const disableDirectives = [];
|
296
|
+
const validator = new ConfigValidator({
|
297
|
+
builtInRules: Rules
|
298
|
+
});
|
296
299
|
|
297
300
|
ast.comments.filter(token => token.type !== "Shebang").forEach(comment => {
|
298
301
|
const trimmedCommentText = stripDirectiveComment(comment.value);
|
@@ -60,7 +60,23 @@ function isPossibleConstructor(node) {
|
|
60
60
|
return node.name !== "undefined";
|
61
61
|
|
62
62
|
case "AssignmentExpression":
|
63
|
-
|
63
|
+
if (["=", "&&="].includes(node.operator)) {
|
64
|
+
return isPossibleConstructor(node.right);
|
65
|
+
}
|
66
|
+
|
67
|
+
if (["||=", "??="].includes(node.operator)) {
|
68
|
+
return (
|
69
|
+
isPossibleConstructor(node.left) ||
|
70
|
+
isPossibleConstructor(node.right)
|
71
|
+
);
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* All other assignment operators are mathematical assignment operators (arithmetic or bitwise).
|
76
|
+
* An assignment expression with a mathematical operator can either evaluate to a primitive value,
|
77
|
+
* or throw, depending on the operands. Thus, it cannot evaluate to a constructor function.
|
78
|
+
*/
|
79
|
+
return false;
|
64
80
|
|
65
81
|
case "LogicalExpression":
|
66
82
|
return (
|