eslint 8.22.0 → 8.33.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 +51 -45
- package/bin/eslint.js +2 -4
- package/conf/globals.js +6 -1
- package/conf/rule-type-list.json +2 -2
- package/lib/cli-engine/file-enumerator.js +4 -2
- package/lib/cli-engine/formatters/formatters-meta.json +46 -0
- package/lib/cli-engine/formatters/html.js +76 -51
- package/lib/cli.js +163 -40
- package/lib/config/default-config.js +2 -2
- package/lib/config/flat-config-array.js +1 -1
- package/lib/eslint/eslint-helpers.js +409 -87
- package/lib/eslint/eslint.js +5 -2
- package/lib/eslint/flat-eslint.js +113 -110
- package/lib/linter/code-path-analysis/code-path-segment.js +2 -2
- package/lib/linter/code-path-analysis/code-path-state.js +7 -7
- package/lib/linter/code-path-analysis/debug-helpers.js +3 -3
- package/lib/linter/code-path-analysis/id-generator.js +2 -2
- package/lib/linter/config-comment-parser.js +1 -2
- package/lib/linter/linter.js +17 -7
- package/lib/linter/timing.js +4 -4
- package/lib/options.js +293 -239
- package/lib/rule-tester/flat-rule-tester.js +13 -11
- package/lib/rule-tester/rule-tester.js +15 -11
- package/lib/rules/array-callback-return.js +2 -2
- package/lib/rules/comma-dangle.js +3 -3
- package/lib/rules/for-direction.js +1 -1
- package/lib/rules/func-name-matching.js +2 -2
- package/lib/rules/getter-return.js +14 -8
- package/lib/rules/global-require.js +2 -1
- package/lib/rules/id-length.js +43 -2
- package/lib/rules/indent-legacy.js +4 -4
- package/lib/rules/indent.js +23 -15
- package/lib/rules/index.js +3 -0
- package/lib/rules/key-spacing.js +50 -38
- package/lib/rules/lines-around-comment.js +2 -2
- package/lib/rules/logical-assignment-operators.js +474 -0
- package/lib/rules/multiline-ternary.js +2 -2
- package/lib/rules/new-cap.js +2 -2
- package/lib/rules/no-else-return.js +1 -1
- package/lib/rules/no-empty-static-block.js +47 -0
- package/lib/rules/no-empty.js +19 -2
- package/lib/rules/no-extra-boolean-cast.js +1 -1
- package/lib/rules/no-extra-parens.js +18 -3
- package/lib/rules/no-fallthrough.js +26 -5
- package/lib/rules/no-implicit-coercion.js +20 -1
- package/lib/rules/no-implicit-globals.js +5 -0
- package/lib/rules/no-invalid-regexp.js +40 -18
- package/lib/rules/no-labels.js +1 -1
- package/lib/rules/no-lone-blocks.js +1 -1
- package/lib/rules/no-loss-of-precision.js +2 -2
- package/lib/rules/no-magic-numbers.js +18 -1
- package/lib/rules/no-misleading-character-class.js +4 -4
- package/lib/rules/no-new-native-nonconstructor.js +64 -0
- package/lib/rules/no-obj-calls.js +1 -1
- package/lib/rules/no-restricted-exports.js +106 -10
- package/lib/rules/no-return-await.js +28 -1
- package/lib/rules/no-underscore-dangle.js +36 -11
- package/lib/rules/no-unneeded-ternary.js +1 -1
- package/lib/rules/no-use-before-define.js +1 -1
- package/lib/rules/no-useless-computed-key.js +1 -1
- package/lib/rules/no-var.js +2 -2
- package/lib/rules/no-warning-comments.js +24 -5
- package/lib/rules/padded-blocks.js +1 -1
- package/lib/rules/prefer-arrow-callback.js +4 -3
- package/lib/rules/prefer-const.js +13 -1
- package/lib/rules/prefer-named-capture-group.js +71 -6
- package/lib/rules/prefer-object-spread.js +1 -1
- package/lib/rules/prefer-regex-literals.js +147 -32
- package/lib/rules/prefer-rest-params.js +1 -1
- package/lib/rules/require-yield.js +0 -1
- package/lib/rules/strict.js +1 -1
- package/lib/rules/utils/ast-utils.js +10 -4
- package/lib/shared/directives.js +15 -0
- package/lib/shared/logging.js +1 -1
- package/lib/shared/runtime-info.js +1 -1
- package/lib/shared/traverser.js +1 -1
- package/lib/shared/types.js +15 -2
- package/lib/source-code/token-store/cursor.js +1 -1
- package/messages/print-config-with-directory-path.js +1 -1
- package/package.json +27 -27
package/README.md
CHANGED
@@ -10,10 +10,10 @@
|
|
10
10
|
# ESLint
|
11
11
|
|
12
12
|
[Website](https://eslint.org) |
|
13
|
-
[
|
13
|
+
[Configure ESLint](https://eslint.org/docs/latest/use/configure) |
|
14
14
|
[Rules](https://eslint.org/docs/rules/) |
|
15
|
-
[
|
16
|
-
[
|
15
|
+
[Contribute to ESLint](https://eslint.org/docs/latest/contribute) |
|
16
|
+
[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) |
|
17
17
|
[Code of Conduct](https://eslint.org/conduct) |
|
18
18
|
[Twitter](https://twitter.com/geteslint) |
|
19
19
|
[Mailing List](https://groups.google.com/group/eslint) |
|
@@ -31,7 +31,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
|
|
31
31
|
2. [Configuration](#configuration)
|
32
32
|
3. [Code of Conduct](#code-of-conduct)
|
33
33
|
4. [Filing Issues](#filing-issues)
|
34
|
-
5. [Frequently Asked Questions](#
|
34
|
+
5. [Frequently Asked Questions](#frequently-asked-questions)
|
35
35
|
6. [Releases](#releases)
|
36
36
|
7. [Security Policy](#security-policy)
|
37
37
|
8. [Semantic Versioning Policy](#semantic-versioning-policy)
|
@@ -41,7 +41,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
|
|
41
41
|
12. [Sponsors](#sponsors)
|
42
42
|
13. [Technology Sponsors](#technology-sponsors)
|
43
43
|
|
44
|
-
##
|
44
|
+
## Installation and Usage
|
45
45
|
|
46
46
|
Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
|
47
47
|
|
@@ -57,9 +57,9 @@ After that, you can run ESLint on any file or directory like this:
|
|
57
57
|
./node_modules/.bin/eslint yourfile.js
|
58
58
|
```
|
59
59
|
|
60
|
-
##
|
60
|
+
## Configuration
|
61
61
|
|
62
|
-
After running `npm init @eslint/config`, you'll have
|
62
|
+
After running `npm init @eslint/config`, you'll have an `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
|
63
63
|
|
64
64
|
```json
|
65
65
|
{
|
@@ -76,28 +76,28 @@ The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/do
|
|
76
76
|
* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
|
77
77
|
* `"error"` or `2` - turn the rule on as an error (exit code will be 1)
|
78
78
|
|
79
|
-
The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/
|
79
|
+
The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/latest/use/configure)).
|
80
80
|
|
81
|
-
##
|
81
|
+
## Code of Conduct
|
82
82
|
|
83
83
|
ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct).
|
84
84
|
|
85
|
-
##
|
85
|
+
## Filing Issues
|
86
86
|
|
87
87
|
Before filing an issue, please be sure to read the guidelines for what you're reporting:
|
88
88
|
|
89
|
-
* [Bug Report](https://eslint.org/docs/
|
90
|
-
* [Propose a New Rule](https://eslint.org/docs/
|
91
|
-
* [Proposing a Rule Change](https://eslint.org/docs/
|
92
|
-
* [Request a Change](https://eslint.org/docs/
|
89
|
+
* [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs)
|
90
|
+
* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule)
|
91
|
+
* [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change)
|
92
|
+
* [Request a Change](https://eslint.org/docs/latest/contribute/request-change)
|
93
93
|
|
94
|
-
##
|
94
|
+
## Frequently Asked Questions
|
95
95
|
|
96
96
|
### I'm using JSCS, should I migrate to ESLint?
|
97
97
|
|
98
98
|
Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported.
|
99
99
|
|
100
|
-
We have prepared a [migration guide](https://eslint.org/docs/
|
100
|
+
We have prepared a [migration guide](https://eslint.org/docs/latest/use/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration.
|
101
101
|
|
102
102
|
We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process.
|
103
103
|
|
@@ -113,11 +113,11 @@ No, ESLint does both traditional linting (looking for problematic patterns) and
|
|
113
113
|
|
114
114
|
### Does ESLint support JSX?
|
115
115
|
|
116
|
-
Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/
|
116
|
+
Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/latest/use/configure)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
|
117
117
|
|
118
118
|
### What ECMAScript versions does ESLint support?
|
119
119
|
|
120
|
-
ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/
|
120
|
+
ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/latest/use/configure).
|
121
121
|
|
122
122
|
### What about experimental features?
|
123
123
|
|
@@ -125,7 +125,7 @@ ESLint's parser only officially supports the latest final ECMAScript standard. W
|
|
125
125
|
|
126
126
|
In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) to use any option available in Babel.
|
127
127
|
|
128
|
-
Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/
|
128
|
+
Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/latest/contribute). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
|
129
129
|
|
130
130
|
### Where to ask for help?
|
131
131
|
|
@@ -141,15 +141,15 @@ We intentionally don't lock dependency versions so that we have the latest compa
|
|
141
141
|
|
142
142
|
The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more.
|
143
143
|
|
144
|
-
##
|
144
|
+
## Releases
|
145
145
|
|
146
146
|
We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release.
|
147
147
|
|
148
|
-
##
|
148
|
+
## Security Policy
|
149
149
|
|
150
150
|
ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).
|
151
151
|
|
152
|
-
##
|
152
|
+
## Semantic Versioning Policy
|
153
153
|
|
154
154
|
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:
|
155
155
|
|
@@ -182,7 +182,7 @@ ESLint follows [semantic versioning](https://semver.org). However, due to the na
|
|
182
182
|
|
183
183
|
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.
|
184
184
|
|
185
|
-
##
|
185
|
+
## Stylistic Rule Updates
|
186
186
|
|
187
187
|
Stylistic rules are frozen according to [our policy](https://eslint.org/blog/2020/05/changes-to-rules-policies) on how we evaluate new rules and rule changes.
|
188
188
|
This means:
|
@@ -191,11 +191,11 @@ This means:
|
|
191
191
|
* **New ECMAScript features**: We will also make sure stylistic rules are compatible with new ECMAScript features.
|
192
192
|
* **New options**: We will **not** add any new options to stylistic rules unless an option is the only way to fix a bug or support a newly-added ECMAScript feature.
|
193
193
|
|
194
|
-
##
|
194
|
+
## License
|
195
195
|
|
196
196
|
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large)
|
197
197
|
|
198
|
-
##
|
198
|
+
## Team
|
199
199
|
|
200
200
|
These folks keep the project moving and are resources for help.
|
201
201
|
|
@@ -245,11 +245,6 @@ Nitin Kumar
|
|
245
245
|
The people who review and fix bugs and help triage issues.
|
246
246
|
|
247
247
|
<table><tbody><tr><td align="center" valign="top" width="11%">
|
248
|
-
<a href="https://github.com/brettz9">
|
249
|
-
<img src="https://github.com/brettz9.png?s=75" width="75" height="75"><br />
|
250
|
-
Brett Zamir
|
251
|
-
</a>
|
252
|
-
</td><td align="center" valign="top" width="11%">
|
253
248
|
<a href="https://github.com/bmish">
|
254
249
|
<img src="https://github.com/bmish.png?s=75" width="75" height="75"><br />
|
255
250
|
Bryan Mishkin
|
@@ -260,38 +255,49 @@ Bryan Mishkin
|
|
260
255
|
Sara Soueidan
|
261
256
|
</a>
|
262
257
|
</td><td align="center" valign="top" width="11%">
|
263
|
-
<a href="https://github.com/
|
264
|
-
<img src="https://github.com/
|
265
|
-
|
258
|
+
<a href="https://github.com/yeonjuan">
|
259
|
+
<img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
|
260
|
+
YeonJuan
|
261
|
+
</a>
|
262
|
+
</td></tr></tbody></table>
|
263
|
+
|
264
|
+
### Website Team
|
265
|
+
|
266
|
+
Team members who focus specifically on eslint.org
|
267
|
+
|
268
|
+
<table><tbody><tr><td align="center" valign="top" width="11%">
|
269
|
+
<a href="https://github.com/amareshsm">
|
270
|
+
<img src="https://github.com/amareshsm.png?s=75" width="75" height="75"><br />
|
271
|
+
Amaresh S M
|
266
272
|
</a>
|
267
273
|
</td><td align="center" valign="top" width="11%">
|
268
|
-
<a href="https://github.com/
|
269
|
-
<img src="https://github.com/
|
270
|
-
|
274
|
+
<a href="https://github.com/harish-sethuraman">
|
275
|
+
<img src="https://github.com/harish-sethuraman.png?s=75" width="75" height="75"><br />
|
276
|
+
Strek
|
271
277
|
</a>
|
272
278
|
</td><td align="center" valign="top" width="11%">
|
273
|
-
<a href="https://github.com/
|
274
|
-
<img src="https://github.com/
|
275
|
-
|
279
|
+
<a href="https://github.com/kecrily">
|
280
|
+
<img src="https://github.com/kecrily.png?s=75" width="75" height="75"><br />
|
281
|
+
Percy Ma
|
276
282
|
</a>
|
277
283
|
</td></tr></tbody></table>
|
278
284
|
|
279
285
|
<!--teamend-->
|
280
286
|
|
281
|
-
##
|
287
|
+
## Sponsors
|
282
288
|
|
283
289
|
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website.
|
284
290
|
|
285
291
|
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
286
292
|
<!--sponsorsstart-->
|
287
293
|
<h3>Platinum Sponsors</h3>
|
288
|
-
<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>
|
289
|
-
<p><a href="https://
|
290
|
-
<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>
|
291
|
-
<p><a href="https://
|
294
|
+
<p><a href="#"><img src="https://images.opencollective.com/2021-frameworks-fund/logo.png" alt="Chrome Frameworks Fund" height="undefined"></a> <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://ridicorp.com/career/"><img src="https://images.opencollective.com/ridi-corporation/175dcf3/logo.png" alt="RIDI" height="96"></a> <a href="https://engineering.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></p><h3>Silver Sponsors</h3>
|
296
|
+
<p><a href="https://sentry.io"><img src="https://avatars.githubusercontent.com/u/1396951?v=4" alt="Sentry" height="64"></a> <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://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" 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://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://transloadit.com/"><img src="https://avatars.githubusercontent.com/u/125754?v=4" alt="Transloadit" 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> <a href="https://quickbookstoolhub.com"><img src="https://avatars.githubusercontent.com/u/95090305?u=e5bc398ef775c9ed19f955c675cdc1fb6abf01df&v=4" alt="QuickBooks Tool hub" height="32"></a></p>
|
292
298
|
<!--sponsorsend-->
|
293
299
|
|
294
|
-
##
|
300
|
+
## Technology Sponsors
|
295
301
|
|
296
302
|
* Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)
|
297
303
|
* Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com)
|
package/bin/eslint.js
CHANGED
@@ -9,9 +9,6 @@
|
|
9
9
|
|
10
10
|
"use strict";
|
11
11
|
|
12
|
-
// to use V8's code cache to speed up instantiation time
|
13
|
-
require("v8-compile-cache");
|
14
|
-
|
15
12
|
// must do this initialization *before* other requires in order to work
|
16
13
|
if (process.argv.includes("--debug")) {
|
17
14
|
require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*");
|
@@ -137,6 +134,7 @@ ${message}`);
|
|
137
134
|
// Otherwise, call the CLI.
|
138
135
|
process.exitCode = await require("../lib/cli").execute(
|
139
136
|
process.argv,
|
140
|
-
process.argv.includes("--stdin") ? await readStdin() : null
|
137
|
+
process.argv.includes("--stdin") ? await readStdin() : null,
|
138
|
+
true
|
141
139
|
);
|
142
140
|
}()).catch(onFatalError);
|
package/conf/globals.js
CHANGED
@@ -124,6 +124,10 @@ const es2022 = {
|
|
124
124
|
...es2021
|
125
125
|
};
|
126
126
|
|
127
|
+
const es2023 = {
|
128
|
+
...es2022
|
129
|
+
};
|
130
|
+
|
127
131
|
|
128
132
|
//-----------------------------------------------------------------------------
|
129
133
|
// Exports
|
@@ -140,5 +144,6 @@ module.exports = {
|
|
140
144
|
es2019,
|
141
145
|
es2020,
|
142
146
|
es2021,
|
143
|
-
es2022
|
147
|
+
es2022,
|
148
|
+
es2023
|
144
149
|
};
|
package/conf/rule-type-list.json
CHANGED
@@ -6,12 +6,12 @@
|
|
6
6
|
],
|
7
7
|
"deprecated": {
|
8
8
|
"name": "Deprecated",
|
9
|
-
"description": "These rules have been deprecated in accordance with the <a href=\"/docs/
|
9
|
+
"description": "These rules have been deprecated in accordance with the <a href=\"/docs/use/rule-deprecation\">deprecation policy</a>, and replaced by newer rules:",
|
10
10
|
"rules": []
|
11
11
|
},
|
12
12
|
"removed": {
|
13
13
|
"name": "Removed",
|
14
|
-
"description": "These rules from older versions of ESLint (before the <a href=\"/docs/
|
14
|
+
"description": "These rules from older versions of ESLint (before the <a href=\"/docs/use/rule-deprecation\">deprecation policy</a> existed) have been replaced by newer rules:",
|
15
15
|
"rules": [
|
16
16
|
{ "removed": "generator-star", "replacedBy": ["generator-star-spacing"] },
|
17
17
|
{ "removed": "global-strict", "replacedBy": ["strict"] },
|
@@ -122,7 +122,8 @@ function statSafeSync(filePath) {
|
|
122
122
|
try {
|
123
123
|
return fs.statSync(filePath);
|
124
124
|
} catch (error) {
|
125
|
-
|
125
|
+
|
126
|
+
/* c8 ignore next */
|
126
127
|
if (error.code !== "ENOENT") {
|
127
128
|
throw error;
|
128
129
|
}
|
@@ -141,7 +142,8 @@ function readdirSafeSync(directoryPath) {
|
|
141
142
|
try {
|
142
143
|
return fs.readdirSync(directoryPath, { withFileTypes: true });
|
143
144
|
} catch (error) {
|
144
|
-
|
145
|
+
|
146
|
+
/* c8 ignore next */
|
145
147
|
if (error.code !== "ENOENT") {
|
146
148
|
throw error;
|
147
149
|
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "checkstyle",
|
4
|
+
"description": "Outputs results to the [Checkstyle](https://checkstyle.sourceforge.io/) format."
|
5
|
+
},
|
6
|
+
{
|
7
|
+
"name": "compact",
|
8
|
+
"description": "Human-readable output format. Mimics the default output of JSHint."
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"name": "html",
|
12
|
+
"description": "Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser."
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "jslint-xml",
|
16
|
+
"description": "Outputs results to format compatible with the [JSLint Jenkins plugin](https://plugins.jenkins.io/jslint/)."
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"name": "json-with-metadata",
|
20
|
+
"description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint."
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"name": "json",
|
24
|
+
"description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint."
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "junit",
|
28
|
+
"description": "Outputs results to format compatible with the [JUnit Jenkins plugin](https://plugins.jenkins.io/junit/)."
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"name": "stylish",
|
32
|
+
"description": "Human-readable output format. This is the default formatter."
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"name": "tap",
|
36
|
+
"description": "Outputs results to the [Test Anything Protocol (TAP)](https://testanything.org/) specification format."
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"name": "unix",
|
40
|
+
"description": "Outputs results to a format similar to many commands in UNIX-like systems. Parsable with tools such as [grep](https://www.gnu.org/software/grep/manual/grep.html), [sed](https://www.gnu.org/software/sed/manual/sed.html), and [awk](https://www.gnu.org/software/gawk/manual/gawk.html)."
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"name": "visualstudio",
|
44
|
+
"description": "Outputs results to format compatible with the integrated terminal of the [Visual Studio](https://visualstudio.microsoft.com/) IDE. When using Visual Studio, you can click on the linting results in the integrated terminal to go to the issue in the source code."
|
45
|
+
}
|
46
|
+
]
|
@@ -43,85 +43,110 @@ function pageTemplate(it) {
|
|
43
43
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMjk0LjgyNSAyNTguOTgyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPg0KPHBhdGggZmlsbD0nIzgwODBGMicgZD0nTTk3LjAyMSw5OS4wMTZsNDguNDMyLTI3Ljk2MmMxLjIxMi0wLjcsMi43MDYtMC43LDMuOTE4LDBsNDguNDMzLDI3Ljk2MiBjMS4yMTEsMC43LDEuOTU5LDEuOTkzLDEuOTU5LDMuMzkzdjU1LjkyNGMwLDEuMzk5LTAuNzQ4LDIuNjkzLTEuOTU5LDMuMzk0bC00OC40MzMsMjcuOTYyYy0xLjIxMiwwLjctMi43MDYsMC43LTMuOTE4LDAgbC00OC40MzItMjcuOTYyYy0xLjIxMi0wLjctMS45NTktMS45OTQtMS45NTktMy4zOTR2LTU1LjkyNEM5NS4wNjMsMTAxLjAwOSw5NS44MSw5OS43MTYsOTcuMDIxLDk5LjAxNicvPg0KPHBhdGggZmlsbD0nIzRCMzJDMycgZD0nTTI3My4zMzYsMTI0LjQ4OEwyMTUuNDY5LDIzLjgxNmMtMi4xMDItMy42NC01Ljk4NS02LjMyNS0xMC4xODgtNi4zMjVIODkuNTQ1IGMtNC4yMDQsMC04LjA4OCwyLjY4NS0xMC4xOSw2LjMyNWwtNTcuODY3LDEwMC40NWMtMi4xMDIsMy42NDEtMi4xMDIsOC4yMzYsMCwxMS44NzdsNTcuODY3LDk5Ljg0NyBjMi4xMDIsMy42NCw1Ljk4Niw1LjUwMSwxMC4xOSw1LjUwMWgxMTUuNzM1YzQuMjAzLDAsOC4wODctMS44MDUsMTAuMTg4LTUuNDQ2bDU3Ljg2Ny0xMDAuMDEgQzI3NS40MzksMTMyLjM5NiwyNzUuNDM5LDEyOC4xMjgsMjczLjMzNiwxMjQuNDg4IE0yMjUuNDE5LDE3Mi44OThjMCwxLjQ4LTAuODkxLDIuODQ5LTIuMTc0LDMuNTlsLTczLjcxLDQyLjUyNyBjLTEuMjgyLDAuNzQtMi44ODgsMC43NC00LjE3LDBsLTczLjc2Ny00Mi41MjdjLTEuMjgyLTAuNzQxLTIuMTc5LTIuMTA5LTIuMTc5LTMuNTlWODcuODQzYzAtMS40ODEsMC44ODQtMi44NDksMi4xNjctMy41OSBsNzMuNzA3LTQyLjUyN2MxLjI4Mi0wLjc0MSwyLjg4Ni0wLjc0MSw0LjE2OCwwbDczLjc3Miw0Mi41MjdjMS4yODMsMC43NDEsMi4xODYsMi4xMDksMi4xODYsMy41OVYxNzIuODk4eicvPg0KPC9zdmc+">
|
44
44
|
<style>
|
45
45
|
body {
|
46
|
-
font-family:Arial, "Helvetica Neue", Helvetica, sans-serif;
|
47
|
-
font-size:16px;
|
48
|
-
font-weight:normal;
|
49
|
-
margin:0;
|
50
|
-
padding:0;
|
51
|
-
color
|
46
|
+
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
47
|
+
font-size: 16px;
|
48
|
+
font-weight: normal;
|
49
|
+
margin: 0;
|
50
|
+
padding: 0;
|
51
|
+
color: #333;
|
52
52
|
}
|
53
|
+
|
53
54
|
#overview {
|
54
|
-
padding:20px 30px
|
55
|
+
padding: 20px 30px;
|
55
56
|
}
|
56
|
-
|
57
|
-
|
57
|
+
|
58
|
+
td,
|
59
|
+
th {
|
60
|
+
padding: 5px 10px;
|
58
61
|
}
|
62
|
+
|
59
63
|
h1 {
|
60
|
-
margin:0
|
64
|
+
margin: 0;
|
61
65
|
}
|
66
|
+
|
62
67
|
table {
|
63
|
-
margin:30px;
|
64
|
-
width:calc(100% - 60px);
|
65
|
-
max-width:1000px;
|
66
|
-
border-radius:5px;
|
67
|
-
border:1px solid #ddd;
|
68
|
-
border-spacing:
|
68
|
+
margin: 30px;
|
69
|
+
width: calc(100% - 60px);
|
70
|
+
max-width: 1000px;
|
71
|
+
border-radius: 5px;
|
72
|
+
border: 1px solid #ddd;
|
73
|
+
border-spacing: 0;
|
69
74
|
}
|
75
|
+
|
70
76
|
th {
|
71
|
-
font-weight:400;
|
72
|
-
font-size:medium;
|
73
|
-
text-align:left;
|
74
|
-
cursor:pointer
|
77
|
+
font-weight: 400;
|
78
|
+
font-size: medium;
|
79
|
+
text-align: left;
|
80
|
+
cursor: pointer;
|
75
81
|
}
|
76
|
-
|
77
|
-
|
82
|
+
|
83
|
+
td.clr-1,
|
84
|
+
td.clr-2,
|
85
|
+
th span {
|
86
|
+
font-weight: 700;
|
78
87
|
}
|
88
|
+
|
79
89
|
th span {
|
80
|
-
float:right;
|
81
|
-
margin-left:20px
|
90
|
+
float: right;
|
91
|
+
margin-left: 20px;
|
82
92
|
}
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
93
|
+
|
94
|
+
th span::after {
|
95
|
+
content: "";
|
96
|
+
clear: both;
|
97
|
+
display: block;
|
87
98
|
}
|
99
|
+
|
88
100
|
tr:last-child td {
|
89
|
-
border-bottom:none
|
101
|
+
border-bottom: none;
|
90
102
|
}
|
91
|
-
|
92
|
-
|
103
|
+
|
104
|
+
tr td:first-child,
|
105
|
+
tr td:last-child {
|
106
|
+
color: #9da0a4;
|
93
107
|
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
108
|
+
|
109
|
+
#overview.bg-0,
|
110
|
+
tr.bg-0 th {
|
111
|
+
color: #468847;
|
112
|
+
background: #dff0d8;
|
113
|
+
border-bottom: 1px solid #d6e9c6;
|
98
114
|
}
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
115
|
+
|
116
|
+
#overview.bg-1,
|
117
|
+
tr.bg-1 th {
|
118
|
+
color: #f0ad4e;
|
119
|
+
background: #fcf8e3;
|
120
|
+
border-bottom: 1px solid #fbeed5;
|
103
121
|
}
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
122
|
+
|
123
|
+
#overview.bg-2,
|
124
|
+
tr.bg-2 th {
|
125
|
+
color: #b94a48;
|
126
|
+
background: #f2dede;
|
127
|
+
border-bottom: 1px solid #eed3d7;
|
108
128
|
}
|
129
|
+
|
109
130
|
td {
|
110
|
-
border-bottom:1px solid #ddd
|
131
|
+
border-bottom: 1px solid #ddd;
|
111
132
|
}
|
133
|
+
|
112
134
|
td.clr-1 {
|
113
|
-
color
|
135
|
+
color: #f0ad4e;
|
114
136
|
}
|
137
|
+
|
115
138
|
td.clr-2 {
|
116
|
-
color
|
139
|
+
color: #b94a48;
|
117
140
|
}
|
141
|
+
|
118
142
|
td a {
|
119
|
-
color
|
120
|
-
text-decoration:none
|
143
|
+
color: #3a33d1;
|
144
|
+
text-decoration: none;
|
121
145
|
}
|
146
|
+
|
122
147
|
td a:hover {
|
123
|
-
color
|
124
|
-
text-decoration:underline
|
148
|
+
color: #272296;
|
149
|
+
text-decoration: underline;
|
125
150
|
}
|
126
151
|
</style>
|
127
152
|
</head>
|
@@ -214,7 +239,7 @@ function messageTemplate(it) {
|
|
214
239
|
} = it;
|
215
240
|
|
216
241
|
return `
|
217
|
-
<tr style="display:none" class="f-${parentIndex}">
|
242
|
+
<tr style="display: none;" class="f-${parentIndex}">
|
218
243
|
<td>${lineNumber}:${columnNumber}</td>
|
219
244
|
<td class="clr-${severityNumber}">${severityName}</td>
|
220
245
|
<td>${encodeHTML(message)}</td>
|