eslint 7.27.0 → 7.31.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,61 @@
1
+ v7.31.0 - July 17, 2021
2
+
3
+ * [`efdbb12`](https://github.com/eslint/eslint/commit/efdbb1227019427ec2d968a8d6e9151dd8a77c35) Upgrade: @eslint/eslintrc to v0.4.3 (#14808) (Brandon Mills)
4
+ * [`a96b05f`](https://github.com/eslint/eslint/commit/a96b05f6c5649cfee112d605c91d95aa191e2f78) Update: add end location to report in `consistent-return` (refs #12334) (#14798) (Nitin Kumar)
5
+ * [`e0e8e30`](https://github.com/eslint/eslint/commit/e0e8e308929c9c66612505f2da89043f8592eea7) Docs: update BUG_REPORT template (#14787) (Nitin Kumar)
6
+ * [`39115c8`](https://github.com/eslint/eslint/commit/39115c8b71d2629161359f6456f47fdbd552fddd) Docs: provide more context to no-eq-null (#14801) (gfyoung)
7
+ * [`9a3c73c`](https://github.com/eslint/eslint/commit/9a3c73c130d437a65f4edba0dcb63390e68cac41) Docs: fix a broken link (#14790) (Sam Chen)
8
+ * [`ddffa8a`](https://github.com/eslint/eslint/commit/ddffa8ad58b4b124b08061e9045fdb5370cbdbe3) Update: Indicating the operator in question (#14764) (Paul Smith)
9
+ * [`bba714c`](https://github.com/eslint/eslint/commit/bba714c2ed813821ed288fbc07722cdde6e534fe) Update: Clarifying what changes need to be made in no-mixed-operators (#14765) (Paul Smith)
10
+ * [`b0d22e3`](https://github.com/eslint/eslint/commit/b0d22e3eff18ea7f08189134c07cddceaec69a09) Docs: Mention benefit of providing `meta.docs.url` (#14774) (Bryan Mishkin)
11
+ * [`000cc79`](https://github.com/eslint/eslint/commit/000cc796fd487e7b9ba8bcc5857dd691044479cc) Sponsors: Sync README with website (ESLint Jenkins)
12
+ * [`a6a7438`](https://github.com/eslint/eslint/commit/a6a7438502abc6a1e29ec35cfbe2058ffc0803b1) Chore: pin fs-teardown@0.1.1 (#14771) (Milos Djermanovic)
13
+
14
+ v7.30.0 - July 2, 2021
15
+
16
+ * [`5f74642`](https://github.com/eslint/eslint/commit/5f746420700d457b92dd86659de588d272937b79) Chore: don't check Program.start in SourceCode#getComments (refs #14744) (#14748) (Milos Djermanovic)
17
+ * [`19a871a`](https://github.com/eslint/eslint/commit/19a871a35ae9997ce352624b1081c96c54b73a9f) Docs: Suggest linting plugins for ESLint plugin developers (#14754) (Bryan Mishkin)
18
+ * [`aa87329`](https://github.com/eslint/eslint/commit/aa87329d919f569404ca573b439934552006572f) Docs: fix broken links (#14756) (Sam Chen)
19
+ * [`278813a`](https://github.com/eslint/eslint/commit/278813a6e759f6b5512ac64c7530c9c51732e692) Docs: fix and add more examples for new-cap rule (fixes #12874) (#14725) (Nitin Kumar)
20
+ * [`ed1da5d`](https://github.com/eslint/eslint/commit/ed1da5d96af2587b7211854e45cf8657ef808710) Update: ecmaVersion allows "latest" (#14720) (薛定谔的猫)
21
+ * [`104c0b5`](https://github.com/eslint/eslint/commit/104c0b592f203d315a108d311c58375357e40b24) Update: improve use-isnan rule to detect `Number.NaN` (fixes #14715) (#14718) (Nitin Kumar)
22
+ * [`b08170b`](https://github.com/eslint/eslint/commit/b08170b92beb22db6ec612ebdfff930f9e0582ab) Update: Implement FlatConfigArray (refs #13481) (#14321) (Nicholas C. Zakas)
23
+ * [`f113cdd`](https://github.com/eslint/eslint/commit/f113cdd872257d72bbd66d95e4eaf13623323b24) Chore: upgrade eslint-plugin-eslint-plugin (#14738) (薛定谔的猫)
24
+ * [`1b8997a`](https://github.com/eslint/eslint/commit/1b8997ab63781f4ebf87e3269400b2ef4c7d2973) Docs: Fix getRulesMetaForResults link syntax (#14723) (Brandon Mills)
25
+ * [`aada733`](https://github.com/eslint/eslint/commit/aada733d2aee830aa32cccb9828cd72db4ccd6bd) Docs: fix two broken links (#14726) (Sam Chen)
26
+ * [`8972529`](https://github.com/eslint/eslint/commit/8972529f82d13bd04059ee8852b4ebb9b5350962) Docs: Update README team and sponsors (ESLint Jenkins)
27
+
28
+ v7.29.0 - June 18, 2021
29
+
30
+ * [`bfbfe5c`](https://github.com/eslint/eslint/commit/bfbfe5c1fd4c39a06d5e159dbe48479ca4305fc0) New: Add only to RuleTester (refs eslint/rfcs#73) (#14677) (Brandon Mills)
31
+ * [`c2cd7b4`](https://github.com/eslint/eslint/commit/c2cd7b4a18057ca6067bdfc16de771dc5d90c0ea) New: Add ESLint#getRulesMetaForResults() (refs #13654) (#14716) (Nicholas C. Zakas)
32
+ * [`eea7e0d`](https://github.com/eslint/eslint/commit/eea7e0d09d6ef43d6663cbe424e7974764a5f7fe) Chore: remove duplicate code (#14719) (Nitin Kumar)
33
+ * [`6a1c7a0`](https://github.com/eslint/eslint/commit/6a1c7a0dac050ea5876972c50563a7eb867b38d3) Fix: allow fallthrough comment inside block (fixes #14701) (#14702) (Kevin Gibbons)
34
+ * [`a47e5e3`](https://github.com/eslint/eslint/commit/a47e5e30b0da364593b6881f6826c595da8696f5) Docs: Add Mega-Linter to the list of integrations (#14707) (Nicolas Vuillamy)
35
+ * [`353ddf9`](https://github.com/eslint/eslint/commit/353ddf965078030794419b089994373e27ffc86e) Chore: enable reportUnusedDisableDirectives in eslint-config-eslint (#14699) (薛定谔的猫)
36
+ * [`757c495`](https://github.com/eslint/eslint/commit/757c49584a5852c468c1b4a0b74ad3aa39d954e5) Chore: add some rules to eslint-config-eslint (#14692) (薛定谔的猫)
37
+ * [`c93a222`](https://github.com/eslint/eslint/commit/c93a222563177a9b5bc7a59aa106bc0a6d31e063) Docs: fix a broken link (#14697) (Sam Chen)
38
+ * [`655c118`](https://github.com/eslint/eslint/commit/655c1187fc845bac61ae8d06c556f1a59ee2071b) Sponsors: Sync README with website (ESLint Jenkins)
39
+ * [`e2bed2e`](https://github.com/eslint/eslint/commit/e2bed2ead22b575d55ccaeed94eecd3a979dd871) Sponsors: Sync README with website (ESLint Jenkins)
40
+ * [`8490fb4`](https://github.com/eslint/eslint/commit/8490fb42e559ef0b3c34ac60be4e05e0d879a9cb) Sponsors: Sync README with website (ESLint Jenkins)
41
+ * [`ddbe877`](https://github.com/eslint/eslint/commit/ddbe877c95224e127215d35562a175c6f2b7ba22) Sponsors: Sync README with website (ESLint Jenkins)
42
+
43
+ v7.28.0 - June 4, 2021
44
+
45
+ * [`1237705`](https://github.com/eslint/eslint/commit/1237705dd08c209c5e3136045ec51a4ba87a3abe) Upgrade: @eslint/eslintrc to 0.4.2 (#14672) (Milos Djermanovic)
46
+ * [`123fb86`](https://github.com/eslint/eslint/commit/123fb8648731c2c23313c544ffa1872d3024fe68) Docs: Add Feedback Needed triage description (#14670) (Nicholas C. Zakas)
47
+ * [`c545163`](https://github.com/eslint/eslint/commit/c5451635b4e89827cfc8d8d77083647c74506e42) Update: support multiline /*eslint-env*/ directives (fixes #14652) (#14660) (薛定谔的猫)
48
+ * [`8d1e75a`](https://github.com/eslint/eslint/commit/8d1e75a31b3e3d67130709a219bdd07ce6f3cf74) Upgrade: glob-parent version in package.json (#14658) (Hamza Najeeb)
49
+ * [`1f048cb`](https://github.com/eslint/eslint/commit/1f048cb0eec660d2052f1758f4b2ad7b1cb424e1) Fix: no-implicit-coercion false positive with `String()` (fixes #14623) (#14641) (Milos Djermanovic)
50
+ * [`d709abf`](https://github.com/eslint/eslint/commit/d709abfdde087325d4578b6709dc61040b8ca9d8) Chore: fix comment location in no-unused-vars (#14648) (Milos Djermanovic)
51
+ * [`e44ce0a`](https://github.com/eslint/eslint/commit/e44ce0a8acfaad513c385150c25e76e82a1b8f12) Fix: no-duplicate-imports allow unmergeable (fixes #12758, fixes #12760) (#14238) (Soufiane Boutahlil)
52
+ * [`bb66a3d`](https://github.com/eslint/eslint/commit/bb66a3d91af426dac9a7ffdbe47bdbbc0ffd4dd7) New: add `getPhysicalFilename()` method to rule context (fixes #11989) (#14616) (Nitin Kumar)
53
+ * [`2e43dac`](https://github.com/eslint/eslint/commit/2e43dacd24337a82d4184fac9b44d497675f46ef) Docs: fix `no-sequences` example (#14643) (Nitin Kumar)
54
+ * [`958ff4e`](https://github.com/eslint/eslint/commit/958ff4e8a5102f204f1484d09985e28a79790996) Docs: add note for arrow functions in no-seq rule (#14578) (Nitin Kumar)
55
+ * [`e4f111b`](https://github.com/eslint/eslint/commit/e4f111b67d114adbf76a9c9dbb18fa4f49bc91b6) Fix: arrow-body-style crash with object pattern (fixes #14633) (#14635) (Milos Djermanovic)
56
+ * [`ec28b5a`](https://github.com/eslint/eslint/commit/ec28b5a2bdc69f34ce29d670f5e84d2446774a00) Chore: upgrade eslint-plugin-eslint-plugin (#14590) (薛定谔的猫)
57
+ * [`85a2725`](https://github.com/eslint/eslint/commit/85a2725b1fade5538e727102d9701ccb503e54d4) Docs: Update README team and sponsors (ESLint Jenkins)
58
+
1
59
  v7.27.0 - May 21, 2021
2
60
 
3
61
  * [`2c0868c`](https://github.com/eslint/eslint/commit/2c0868cbeadc9f42716fa1178ebdc6b4cee6d31e) Chore: merge all html formatter files into `html.js` (#14612) (Milos Djermanovic)
package/README.md CHANGED
@@ -223,11 +223,6 @@ Nicholas C. Zakas
223
223
  Brandon Mills
224
224
  </a>
225
225
  </td><td align="center" valign="top" width="11%">
226
- <a href="https://github.com/mysticatea">
227
- <img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br />
228
- Toru Nagashima
229
- </a>
230
- </td><td align="center" valign="top" width="11%">
231
226
  <a href="https://github.com/mdjermanovic">
232
227
  <img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
233
228
  Milos Djermanovic
@@ -273,6 +268,11 @@ Anix
273
268
  <img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
274
269
  YeonJuan
275
270
  </a>
271
+ </td><td align="center" valign="top" width="11%">
272
+ <a href="https://github.com/snitin315">
273
+ <img src="https://github.com/snitin315.png?s=75" width="75" height="75"><br />
274
+ Nitin Kumar
275
+ </a>
276
276
  </td></tr></tbody></table>
277
277
 
278
278
 
@@ -286,9 +286,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
286
286
  <!--sponsorsstart-->
287
287
  <h3>Platinum Sponsors</h3>
288
288
  <p><a href="https://automattic.com"><img src="https://images.opencollective.com/photomatt/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
289
- <p><a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <a href="https://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.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://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3>
289
+ <p><a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <a href="https://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.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://coinbase.com"><img src="https://avatars.githubusercontent.com/u/1885080?v=4" alt="Coinbase" height="96"></a> <a href="https://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3>
290
290
  <p><a href="https://retool.com/"><img src="https://images.opencollective.com/retool/98ea68e/logo.png" alt="Retool" 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>
291
- <p><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://discord.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>
291
+ <p><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://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://www.practiceignition.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Practice Ignition" height="32"></a></p>
292
292
  <!--sponsorsend-->
293
293
 
294
294
  ## <a name="technology-sponsors"></a>Technology Sponsors
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @fileoverview Default configuration
3
+ * @author Nicholas C. Zakas
4
+ */
5
+
6
+ "use strict";
7
+
8
+ //-----------------------------------------------------------------------------
9
+ // Requirements
10
+ //-----------------------------------------------------------------------------
11
+
12
+ const Rules = require("../rules");
13
+
14
+ //-----------------------------------------------------------------------------
15
+ // Helpers
16
+ //-----------------------------------------------------------------------------
17
+
18
+
19
+ exports.defaultConfig = [
20
+ {
21
+ plugins: {
22
+ "@": {
23
+ parsers: {
24
+ espree: require("espree")
25
+ },
26
+
27
+ /*
28
+ * Because we try to delay loading rules until absolutely
29
+ * necessary, a proxy allows us to hook into the lazy-loading
30
+ * aspect of the rules map while still keeping all of the
31
+ * relevant configuration inside of the config array.
32
+ */
33
+ rules: new Proxy({}, {
34
+ get(target, property) {
35
+ return Rules.get(property);
36
+ },
37
+
38
+ has(target, property) {
39
+ return Rules.has(property);
40
+ }
41
+ })
42
+ }
43
+ },
44
+ ignores: [
45
+ "**/node_modules/**",
46
+ ".git/**"
47
+ ],
48
+ languageOptions: {
49
+ parser: "@/espree"
50
+ }
51
+ }
52
+ ];
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @fileoverview Flat Config Array
3
+ * @author Nicholas C. Zakas
4
+ */
5
+
6
+ "use strict";
7
+
8
+ //-----------------------------------------------------------------------------
9
+ // Requirements
10
+ //-----------------------------------------------------------------------------
11
+
12
+ const { ConfigArray, ConfigArraySymbol } = require("@humanwhocodes/config-array");
13
+ const { flatConfigSchema } = require("./flat-config-schema");
14
+ const { RuleValidator } = require("./rule-validator");
15
+ const { defaultConfig } = require("./default-config");
16
+ const recommendedConfig = require("../../conf/eslint-recommended");
17
+ const allConfig = require("../../conf/eslint-all");
18
+
19
+ //-----------------------------------------------------------------------------
20
+ // Helpers
21
+ //-----------------------------------------------------------------------------
22
+
23
+ const ruleValidator = new RuleValidator();
24
+
25
+ /**
26
+ * Splits a plugin identifier in the form a/b/c into two parts: a/b and c.
27
+ * @param {string} identifier The identifier to parse.
28
+ * @returns {{objectName: string, pluginName: string}} The parts of the plugin
29
+ * name.
30
+ */
31
+ function splitPluginIdentifier(identifier) {
32
+ const parts = identifier.split("/");
33
+
34
+ return {
35
+ objectName: parts.pop(),
36
+ pluginName: parts.join("/")
37
+ };
38
+ }
39
+
40
+ //-----------------------------------------------------------------------------
41
+ // Exports
42
+ //-----------------------------------------------------------------------------
43
+
44
+ /**
45
+ * Represents an array containing configuration information for ESLint.
46
+ */
47
+ class FlatConfigArray extends ConfigArray {
48
+
49
+ /**
50
+ * Creates a new instance.
51
+ * @param {*[]} configs An array of configuration information.
52
+ * @param {{basePath: string, baseConfig: FlatConfig}} options The options
53
+ * to use for the config array instance.
54
+ */
55
+ constructor(configs, { basePath, baseConfig = defaultConfig }) {
56
+ super(configs, {
57
+ basePath,
58
+ schema: flatConfigSchema
59
+ });
60
+
61
+ this.unshift(baseConfig);
62
+ }
63
+
64
+ /* eslint-disable class-methods-use-this */
65
+ /**
66
+ * Replaces a config with another config to allow us to put strings
67
+ * in the config array that will be replaced by objects before
68
+ * normalization.
69
+ * @param {Object} config The config to preprocess.
70
+ * @returns {Object} The preprocessed config.
71
+ */
72
+ [ConfigArraySymbol.preprocessConfig](config) {
73
+ if (config === "eslint:recommended") {
74
+ return recommendedConfig;
75
+ }
76
+
77
+ if (config === "eslint:all") {
78
+ return allConfig;
79
+ }
80
+
81
+ return config;
82
+ }
83
+
84
+ /**
85
+ * Finalizes the config by replacing plugin references with their objects
86
+ * and validating rule option schemas.
87
+ * @param {Object} config The config to finalize.
88
+ * @returns {Object} The finalized config.
89
+ * @throws {TypeError} If the config is invalid.
90
+ */
91
+ [ConfigArraySymbol.finalizeConfig](config) {
92
+
93
+ const { plugins, languageOptions, processor } = config;
94
+
95
+ // Check parser value
96
+ if (languageOptions && languageOptions.parser && typeof languageOptions.parser === "string") {
97
+ const { pluginName, objectName: parserName } = splitPluginIdentifier(languageOptions.parser);
98
+
99
+ if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[parserName]) {
100
+ throw new TypeError(`Key "parser": Could not find "${parserName}" in plugin "${pluginName}".`);
101
+ }
102
+
103
+ languageOptions.parser = plugins[pluginName].parsers[parserName];
104
+ }
105
+
106
+ // Check processor value
107
+ if (processor && typeof processor === "string") {
108
+ const { pluginName, objectName: processorName } = splitPluginIdentifier(processor);
109
+
110
+ if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[processorName]) {
111
+ throw new TypeError(`Key "processor": Could not find "${processorName}" in plugin "${pluginName}".`);
112
+ }
113
+
114
+ config.processor = plugins[pluginName].processors[processorName];
115
+ }
116
+
117
+ ruleValidator.validate(config);
118
+
119
+ return config;
120
+ }
121
+ /* eslint-enable class-methods-use-this */
122
+
123
+ }
124
+
125
+ exports.FlatConfigArray = FlatConfigArray;