immosquare-cleaner 0.1.50 → 0.1.51
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/linters/rubocop-3.3.4.yml +2 -0
- data/linters/rubocop.yml +2 -0
- data/node_modules/@eslint/core/README.md +10 -11
- data/node_modules/@eslint/core/dist/cjs/types.d.cts +4 -0
- data/node_modules/@eslint/core/dist/esm/types.d.ts +4 -0
- data/node_modules/@eslint/core/package.json +1 -1
- data/node_modules/@eslint/js/package.json +1 -1
- data/node_modules/eslint/README.md +7 -8
- data/node_modules/eslint/bin/eslint.js +5 -0
- data/node_modules/eslint/lib/cli.js +13 -12
- data/node_modules/eslint/lib/config/config-loader.js +16 -7
- data/node_modules/eslint/lib/config/config.js +13 -10
- data/node_modules/eslint/lib/config/default-config.js +2 -8
- data/node_modules/eslint/lib/eslint/eslint.js +11 -0
- data/node_modules/eslint/lib/languages/js/index.js +8 -0
- data/node_modules/eslint/lib/linter/linter.js +16 -19
- data/node_modules/eslint/lib/rule-tester/rule-tester.js +6 -16
- data/node_modules/eslint/lib/types/index.d.ts +12 -0
- data/node_modules/eslint/lib/types/rules/best-practices.d.ts +33 -2
- data/node_modules/eslint/lib/types/rules/deprecated.d.ts +18 -77
- data/node_modules/eslint/lib/types/rules/ecmascript-6.d.ts +22 -6
- data/node_modules/eslint/lib/types/rules/possible-errors.d.ts +2 -0
- data/node_modules/eslint/lib/types/rules/stylistic-issues.d.ts +68 -5
- data/node_modules/eslint/lib/types/rules/variables.d.ts +9 -1
- data/node_modules/eslint/package.json +5 -4
- data/node_modules/npm-check-updates/build/index.js +266 -266
- data/node_modules/npm-check-updates/build/index.js.map +1 -1
- data/node_modules/npm-check-updates/package.json +1 -1
- data/package.json +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aef8f577c4d17faa58744f6ac77dec8ece7c40548849976e10089396902c4e7
|
4
|
+
data.tar.gz: 3a1249ca6e46964111e346f751de0e32a8b657182fb180bee015fd61721a335b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb8ec0a2744b3690489445b050d3fda2855f84bd8775432c68322d7aae5b8e9fe68473460cb90933ef7371661166ccb6717d9ad637f51a802a50315f14f22059
|
7
|
+
data.tar.gz: 7c5cf8a3e3d45eaa7fef7bfab5bf68f3c86e6eb6b981df1cd1b3d486629d13b8c48c2269663654cd70a527902f3fd59af944045920c8f59deba7a548b747de99
|
data/linters/rubocop-3.3.4.yml
CHANGED
data/linters/rubocop.yml
CHANGED
@@ -62,6 +62,8 @@ Layout/MultilineMethodCallIndentation:
|
|
62
62
|
EnforcedStyle: indented
|
63
63
|
|
64
64
|
#################### Style ###########################
|
65
|
+
Style/CombinableLoops:
|
66
|
+
Enabled: false # On veut pouvoir combiner les loops
|
65
67
|
Style/SingleArgumentDig:
|
66
68
|
Enabled: false # On ne veut pas transformer les .dig de 1 argument en array car on a fait un override de dig pour ajouter dig sur les active record dans le gem immosquare-extensions
|
67
69
|
Style/RedundantBegin:
|
@@ -10,21 +10,20 @@ Right now, it exports the core types necessary to implement language plugins.
|
|
10
10
|
|
11
11
|
Apache 2.0
|
12
12
|
|
13
|
+
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
14
|
+
<!--sponsorsstart-->
|
15
|
+
|
13
16
|
## Sponsors
|
14
17
|
|
15
|
-
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
|
18
|
+
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
|
19
|
+
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
16
20
|
|
17
|
-
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
18
|
-
<!--sponsorsstart-->
|
19
21
|
<h3>Platinum Sponsors</h3>
|
20
22
|
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
21
|
-
<p><a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/avatar.png" alt="trunk.io" height="96"></a
|
23
|
+
<p><a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a></p><h3>Silver Sponsors</h3>
|
22
24
|
<p><a href="https://www.jetbrains.com/"><img src="https://images.opencollective.com/jetbrains/fe76f99/logo.png" alt="JetBrains" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="64"></a> <a href="https://www.workleap.com"><img src="https://avatars.githubusercontent.com/u/53535748?u=d1e55d7661d724bf2281c1bfd33cb8f99fe2465f&v=4" alt="Workleap" height="64"></a></p><h3>Bronze Sponsors</h3>
|
23
|
-
<p><a href="https://www.
|
25
|
+
<p><a href="https://www.wordhint.net/"><img src="https://images.opencollective.com/wordhint/be86813/avatar.png" alt="WordHint" 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" 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://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340?v=4" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104?v=4" alt="Nx" 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://usenextbase.com"><img src="https://avatars.githubusercontent.com/u/145838380?v=4" alt="Nextbase Starter Kit" height="32"></a></p>
|
26
|
+
<h3>Technology Sponsors</h3>
|
27
|
+
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
28
|
+
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
24
29
|
<!--sponsorsend-->
|
25
|
-
|
26
|
-
<!--techsponsorsstart-->
|
27
|
-
<h2>Technology Sponsors</h2>
|
28
|
-
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a>
|
29
|
-
</p>
|
30
|
-
<!--techsponsorsend-->
|
@@ -124,6 +124,10 @@ export interface Language {
|
|
124
124
|
* The traversal path that tools should take when evaluating the AST
|
125
125
|
*/
|
126
126
|
visitorKeys?: Record<string, string[]>;
|
127
|
+
/**
|
128
|
+
* Default language options. User-defined options are merged with this object.
|
129
|
+
*/
|
130
|
+
defaultLanguageOptions?: LanguageOptions;
|
127
131
|
/**
|
128
132
|
* Validates languageOptions for this language.
|
129
133
|
*/
|
@@ -124,6 +124,10 @@ export interface Language {
|
|
124
124
|
* The traversal path that tools should take when evaluating the AST
|
125
125
|
*/
|
126
126
|
visitorKeys?: Record<string, string[]>;
|
127
|
+
/**
|
128
|
+
* Default language options. User-defined options are merged with this object.
|
129
|
+
*/
|
130
|
+
defaultLanguageOptions?: LanguageOptions;
|
127
131
|
/**
|
128
132
|
* Validates languageOptions for this language.
|
129
133
|
*/
|
@@ -289,23 +289,22 @@ Percy Ma
|
|
289
289
|
|
290
290
|
<!--teamend-->
|
291
291
|
|
292
|
+
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
293
|
+
<!--sponsorsstart-->
|
292
294
|
## Sponsors
|
293
295
|
|
294
|
-
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
|
296
|
+
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
|
297
|
+
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
295
298
|
|
296
|
-
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
297
|
-
<!--sponsorsstart-->
|
298
299
|
<h3>Platinum Sponsors</h3>
|
299
300
|
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
300
301
|
<p><a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a></p><h3>Silver Sponsors</h3>
|
301
302
|
<p><a href="https://www.jetbrains.com/"><img src="https://images.opencollective.com/jetbrains/fe76f99/logo.png" alt="JetBrains" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="64"></a> <a href="https://www.workleap.com"><img src="https://avatars.githubusercontent.com/u/53535748?u=d1e55d7661d724bf2281c1bfd33cb8f99fe2465f&v=4" alt="Workleap" height="64"></a></p><h3>Bronze Sponsors</h3>
|
302
303
|
<p><a href="https://www.wordhint.net/"><img src="https://images.opencollective.com/wordhint/be86813/avatar.png" alt="WordHint" 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" 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://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340?v=4" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104?v=4" alt="Nx" 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://usenextbase.com"><img src="https://avatars.githubusercontent.com/u/145838380?v=4" alt="Nextbase Starter Kit" height="32"></a></p>
|
303
|
-
|
304
|
-
|
305
|
-
<!--techsponsorsstart-->
|
306
|
-
<h2>Technology Sponsors</h2>
|
304
|
+
<h3>Technology Sponsors</h3>
|
305
|
+
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
307
306
|
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
308
|
-
<!--
|
307
|
+
<!--sponsorsend-->
|
309
308
|
|
310
309
|
[tidelift]: https://tidelift.com/funding/github/npm/eslint
|
311
310
|
[herodevs]: https://www.herodevs.com/support/eslint-nes?utm_source=ESLintWebsite&utm_medium=ESLintWebsite&utm_campaign=ESLintNES&utm_id=ESLintNES
|
@@ -9,6 +9,11 @@
|
|
9
9
|
|
10
10
|
"use strict";
|
11
11
|
|
12
|
+
const mod = require("node:module");
|
13
|
+
|
14
|
+
// to use V8's code cache to speed up instantiation time
|
15
|
+
mod.enableCompileCache?.();
|
16
|
+
|
12
17
|
// must do this initialization *before* other requires in order to work
|
13
18
|
if (process.argv.includes("--debug")) {
|
14
19
|
require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*");
|
@@ -146,24 +146,29 @@ async function translateOptions({
|
|
146
146
|
overrideConfigFile = void 0;
|
147
147
|
}
|
148
148
|
|
149
|
-
|
149
|
+
const languageOptions = {};
|
150
150
|
|
151
151
|
if (global) {
|
152
|
-
globals = global.reduce((obj, name) => {
|
152
|
+
languageOptions.globals = global.reduce((obj, name) => {
|
153
153
|
if (name.endsWith(":true")) {
|
154
154
|
obj[name.slice(0, -5)] = "writable";
|
155
155
|
} else {
|
156
156
|
obj[name] = "readonly";
|
157
157
|
}
|
158
158
|
return obj;
|
159
|
-
},
|
159
|
+
}, {});
|
160
|
+
}
|
161
|
+
|
162
|
+
if (parserOptions) {
|
163
|
+
languageOptions.parserOptions = parserOptions;
|
164
|
+
}
|
165
|
+
|
166
|
+
if (parser) {
|
167
|
+
languageOptions.parser = await importer.import(parser);
|
160
168
|
}
|
161
169
|
|
162
170
|
overrideConfig = [{
|
163
|
-
languageOptions: {
|
164
|
-
globals,
|
165
|
-
parserOptions: parserOptions || {}
|
166
|
-
},
|
171
|
+
...Object.keys(languageOptions).length > 0 ? { languageOptions } : {},
|
167
172
|
rules: rule ? rule : {}
|
168
173
|
}];
|
169
174
|
|
@@ -175,10 +180,6 @@ async function translateOptions({
|
|
175
180
|
};
|
176
181
|
}
|
177
182
|
|
178
|
-
if (parser) {
|
179
|
-
overrideConfig[0].languageOptions.parser = await importer.import(parser);
|
180
|
-
}
|
181
|
-
|
182
183
|
if (plugin) {
|
183
184
|
overrideConfig[0].plugins = await loadPlugins(importer, plugin);
|
184
185
|
}
|
@@ -378,7 +379,7 @@ const cli = {
|
|
378
379
|
debug("Using flat config?", usingFlatConfig);
|
379
380
|
|
380
381
|
if (allowFlatConfig && !usingFlatConfig) {
|
381
|
-
process.emitWarning("You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details.", "ESLintRCWarning");
|
382
|
+
process.emitWarning("You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.", "ESLintRCWarning");
|
382
383
|
}
|
383
384
|
|
384
385
|
const CLIOptions = createCLIOptions(usingFlatConfig);
|
@@ -173,21 +173,22 @@ async function loadConfigFile(filePath, allowTS) {
|
|
173
173
|
*/
|
174
174
|
if (allowTS && isTS && !isDeno && !isBun) {
|
175
175
|
|
176
|
-
|
176
|
+
// eslint-disable-next-line no-use-before-define -- `ConfigLoader.loadJiti` can be overwritten for testing
|
177
|
+
const { createJiti } = await ConfigLoader.loadJiti().catch(() => {
|
177
178
|
throw new Error("The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.");
|
178
179
|
});
|
179
180
|
|
181
|
+
// `createJiti` was added in jiti v2.
|
182
|
+
if (typeof createJiti !== "function") {
|
183
|
+
throw new Error("You are using an outdated version of the 'jiti' library. Please update to the latest version of 'jiti' to ensure compatibility and access to the latest features.");
|
184
|
+
}
|
185
|
+
|
180
186
|
/*
|
181
187
|
* Disabling `moduleCache` allows us to reload a
|
182
188
|
* config file when the last modified timestamp changes.
|
183
189
|
*/
|
184
190
|
|
185
191
|
const jiti = createJiti(__filename, { moduleCache: false, interopDefault: false });
|
186
|
-
|
187
|
-
if (typeof jiti?.import !== "function") {
|
188
|
-
throw new Error("You are using an outdated version of the 'jiti' library. Please update to the latest version of 'jiti' to ensure compatibility and access to the latest features.");
|
189
|
-
}
|
190
|
-
|
191
192
|
const config = await jiti.import(fileURL.href);
|
192
193
|
|
193
194
|
importedConfigFileModificationTime.set(filePath, mtime);
|
@@ -294,7 +295,6 @@ async function calculateConfigArray(configFilePath, basePath, options) {
|
|
294
295
|
return configs;
|
295
296
|
}
|
296
297
|
|
297
|
-
|
298
298
|
//-----------------------------------------------------------------------------
|
299
299
|
// Exports
|
300
300
|
//-----------------------------------------------------------------------------
|
@@ -517,6 +517,15 @@ class ConfigLoader {
|
|
517
517
|
return this.#configArrays.get(configFilePath);
|
518
518
|
}
|
519
519
|
|
520
|
+
/**
|
521
|
+
* Used to import the jiti dependency. This method is exposed internally for testing purposes.
|
522
|
+
* @returns {Promise<Record<string, unknown>>} A promise that fulfills with a module object
|
523
|
+
* or rejects with an error if jiti is not found.
|
524
|
+
*/
|
525
|
+
static loadJiti() {
|
526
|
+
return import("jiti");
|
527
|
+
}
|
528
|
+
|
520
529
|
}
|
521
530
|
|
522
531
|
/**
|
@@ -188,10 +188,6 @@ class Config {
|
|
188
188
|
this.plugins = plugins;
|
189
189
|
this.language = language;
|
190
190
|
|
191
|
-
if (languageOptions) {
|
192
|
-
this.languageOptions = languageOptions;
|
193
|
-
}
|
194
|
-
|
195
191
|
// Check language value
|
196
192
|
const { pluginName: languagePluginName, objectName: localLanguageName } = splitPluginIdentifier(language);
|
197
193
|
|
@@ -203,13 +199,20 @@ class Config {
|
|
203
199
|
|
204
200
|
this.language = plugins[languagePluginName].languages[localLanguageName];
|
205
201
|
|
202
|
+
if (this.language.defaultLanguageOptions ?? languageOptions) {
|
203
|
+
this.languageOptions = flatConfigSchema.languageOptions.merge(
|
204
|
+
this.language.defaultLanguageOptions,
|
205
|
+
languageOptions
|
206
|
+
);
|
207
|
+
} else {
|
208
|
+
this.languageOptions = {};
|
209
|
+
}
|
210
|
+
|
206
211
|
// Validate language options
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
throw new TypeError(`Key "languageOptions": ${error.message}`, { cause: error });
|
212
|
-
}
|
212
|
+
try {
|
213
|
+
this.language.validateLanguageOptions(this.languageOptions);
|
214
|
+
} catch (error) {
|
215
|
+
throw new TypeError(`Key "languageOptions": ${error.message}`, { cause: error });
|
213
216
|
}
|
214
217
|
|
215
218
|
// Check processor value
|
@@ -15,7 +15,7 @@ const Rules = require("../rules");
|
|
15
15
|
// Helpers
|
16
16
|
//-----------------------------------------------------------------------------
|
17
17
|
|
18
|
-
exports.defaultConfig = [
|
18
|
+
exports.defaultConfig = Object.freeze([
|
19
19
|
{
|
20
20
|
plugins: {
|
21
21
|
"@": {
|
@@ -42,12 +42,6 @@ exports.defaultConfig = [
|
|
42
42
|
}
|
43
43
|
},
|
44
44
|
language: "@/js",
|
45
|
-
languageOptions: {
|
46
|
-
sourceType: "module",
|
47
|
-
ecmaVersion: "latest",
|
48
|
-
parser: require("espree"),
|
49
|
-
parserOptions: {}
|
50
|
-
},
|
51
45
|
linterOptions: {
|
52
46
|
reportUnusedDisableDirectives: 1
|
53
47
|
}
|
@@ -72,4 +66,4 @@ exports.defaultConfig = [
|
|
72
66
|
ecmaVersion: "latest"
|
73
67
|
}
|
74
68
|
}
|
75
|
-
];
|
69
|
+
]);
|
@@ -15,6 +15,7 @@ const path = require("node:path");
|
|
15
15
|
const { version } = require("../../package.json");
|
16
16
|
const { Linter } = require("../linter");
|
17
17
|
const { getRuleFromConfig } = require("../config/flat-config-helpers");
|
18
|
+
const { defaultConfig } = require("../config/default-config");
|
18
19
|
const {
|
19
20
|
Legacy: {
|
20
21
|
ConfigOps: {
|
@@ -52,6 +53,7 @@ const { ConfigLoader, LegacyConfigLoader } = require("../config/config-loader");
|
|
52
53
|
//------------------------------------------------------------------------------
|
53
54
|
|
54
55
|
// For VSCode IntelliSense
|
56
|
+
/** @typedef {import("../cli-engine/cli-engine").ConfigArray} ConfigArray */
|
55
57
|
/** @typedef {import("../shared/types").ConfigData} ConfigData */
|
56
58
|
/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
|
57
59
|
/** @typedef {import("../shared/types").LintMessage} LintMessage */
|
@@ -522,6 +524,15 @@ class ESLint {
|
|
522
524
|
return version;
|
523
525
|
}
|
524
526
|
|
527
|
+
/**
|
528
|
+
* The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint.
|
529
|
+
* Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
|
530
|
+
* @type {ConfigArray}
|
531
|
+
*/
|
532
|
+
static get defaultConfig() {
|
533
|
+
return defaultConfig;
|
534
|
+
}
|
535
|
+
|
525
536
|
/**
|
526
537
|
* Outputs fixes from the given results to files.
|
527
538
|
* @param {LintResult[]} results The lint results.
|
@@ -12,6 +12,7 @@
|
|
12
12
|
const { SourceCode } = require("./source-code");
|
13
13
|
const createDebug = require("debug");
|
14
14
|
const astUtils = require("../../shared/ast-utils");
|
15
|
+
const espree = require("espree");
|
15
16
|
const eslintScope = require("eslint-scope");
|
16
17
|
const evk = require("eslint-visitor-keys");
|
17
18
|
const { validateLanguageOptions } = require("./validate-language-options");
|
@@ -69,6 +70,13 @@ module.exports = {
|
|
69
70
|
nodeTypeKey: "type",
|
70
71
|
visitorKeys: evk.KEYS,
|
71
72
|
|
73
|
+
defaultLanguageOptions: {
|
74
|
+
sourceType: "module",
|
75
|
+
ecmaVersion: "latest",
|
76
|
+
parser: espree,
|
77
|
+
parserOptions: {}
|
78
|
+
},
|
79
|
+
|
72
80
|
validateLanguageOptions,
|
73
81
|
|
74
82
|
/**
|
@@ -1643,29 +1643,26 @@ class Linter {
|
|
1643
1643
|
const options = normalizeVerifyOptions(providedOptions, config);
|
1644
1644
|
const languageOptions = config.languageOptions;
|
1645
1645
|
|
1646
|
-
|
1647
|
-
languageOptions.ecmaVersion
|
1648
|
-
|
1649
|
-
|
1650
|
-
// double check that there is a parser to avoid mysterious error messages
|
1651
|
-
if (!languageOptions.parser) {
|
1652
|
-
throw new TypeError(`No parser specified for ${options.filename}`);
|
1653
|
-
}
|
1646
|
+
if (config.language === jslang) {
|
1647
|
+
languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(
|
1648
|
+
languageOptions.ecmaVersion
|
1649
|
+
);
|
1654
1650
|
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1651
|
+
// Espree expects this information to be passed in
|
1652
|
+
if (isEspree(languageOptions.parser)) {
|
1653
|
+
const parserOptions = languageOptions.parserOptions;
|
1658
1654
|
|
1659
|
-
|
1655
|
+
if (languageOptions.sourceType) {
|
1660
1656
|
|
1661
|
-
|
1657
|
+
parserOptions.sourceType = languageOptions.sourceType;
|
1662
1658
|
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1659
|
+
if (
|
1660
|
+
parserOptions.sourceType === "module" &&
|
1661
|
+
parserOptions.ecmaFeatures &&
|
1662
|
+
parserOptions.ecmaFeatures.globalReturn
|
1663
|
+
) {
|
1664
|
+
parserOptions.ecmaFeatures.globalReturn = false;
|
1665
|
+
}
|
1669
1666
|
}
|
1670
1667
|
}
|
1671
1668
|
}
|
@@ -30,6 +30,7 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser");
|
|
30
30
|
const { ConfigArraySymbol } = require("@eslint/config-array");
|
31
31
|
const { isSerializable } = require("../shared/serialization");
|
32
32
|
|
33
|
+
const jslang = require("../languages/js");
|
33
34
|
const { SourceCode } = require("../languages/js/source-code");
|
34
35
|
|
35
36
|
//------------------------------------------------------------------------------
|
@@ -619,10 +620,7 @@ class RuleTester {
|
|
619
620
|
}
|
620
621
|
}
|
621
622
|
},
|
622
|
-
language: defaultConfig[0].language
|
623
|
-
languageOptions: {
|
624
|
-
...defaultConfig[0].languageOptions
|
625
|
-
}
|
623
|
+
language: defaultConfig[0].language
|
626
624
|
},
|
627
625
|
...defaultConfig.slice(1)
|
628
626
|
];
|
@@ -673,7 +671,10 @@ class RuleTester {
|
|
673
671
|
const calculatedConfig = proto[ConfigArraySymbol.finalizeConfig].apply(this, args);
|
674
672
|
|
675
673
|
// wrap the parser to catch start/end property access
|
676
|
-
calculatedConfig.
|
674
|
+
if (calculatedConfig.language === jslang) {
|
675
|
+
calculatedConfig.languageOptions.parser = wrapParser(calculatedConfig.languageOptions.parser);
|
676
|
+
}
|
677
|
+
|
677
678
|
return calculatedConfig;
|
678
679
|
};
|
679
680
|
|
@@ -694,17 +695,6 @@ class RuleTester {
|
|
694
695
|
delete itemConfig[parameter];
|
695
696
|
}
|
696
697
|
|
697
|
-
// wrap any parsers
|
698
|
-
if (itemConfig.languageOptions && itemConfig.languageOptions.parser) {
|
699
|
-
|
700
|
-
const parser = itemConfig.languageOptions.parser;
|
701
|
-
|
702
|
-
if (parser && typeof parser !== "object") {
|
703
|
-
throw new Error("Parser must be an object with a parse() or parseForESLint() method.");
|
704
|
-
}
|
705
|
-
|
706
|
-
}
|
707
|
-
|
708
698
|
/*
|
709
699
|
* Create the config object from the tester config and this item
|
710
700
|
* specific configurations.
|
@@ -1179,6 +1179,9 @@ export namespace Linter {
|
|
1179
1179
|
ruleId: string | null;
|
1180
1180
|
message: string;
|
1181
1181
|
messageId?: string | undefined;
|
1182
|
+
/**
|
1183
|
+
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
|
1184
|
+
*/
|
1182
1185
|
nodeType?: string | undefined;
|
1183
1186
|
fatal?: true | undefined;
|
1184
1187
|
severity: Exclude<Severity, 0>;
|
@@ -1396,6 +1399,12 @@ export class ESLint {
|
|
1396
1399
|
|
1397
1400
|
static readonly version: string;
|
1398
1401
|
|
1402
|
+
/**
|
1403
|
+
* The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint.
|
1404
|
+
* Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
|
1405
|
+
*/
|
1406
|
+
static readonly defaultConfig: Linter.Config[];
|
1407
|
+
|
1399
1408
|
static outputFixes(results: ESLint.LintResult[]): Promise<void>;
|
1400
1409
|
|
1401
1410
|
static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];
|
@@ -1655,6 +1664,9 @@ export namespace RuleTester {
|
|
1655
1664
|
interface TestCaseError {
|
1656
1665
|
message?: string | RegExp;
|
1657
1666
|
messageId?: string;
|
1667
|
+
/**
|
1668
|
+
* @deprecated `type` is deprecated and will be removed in the next major version.
|
1669
|
+
*/
|
1658
1670
|
type?: string | undefined;
|
1659
1671
|
data?: any;
|
1660
1672
|
line?: number | undefined;
|
@@ -118,6 +118,11 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
118
118
|
* @default 20
|
119
119
|
*/
|
120
120
|
maximum: number;
|
121
|
+
/**
|
122
|
+
* @default "classic"
|
123
|
+
* @since 9.12.0
|
124
|
+
*/
|
125
|
+
variant: "classic" | "modified";
|
121
126
|
}>
|
122
127
|
| number,
|
123
128
|
]
|
@@ -185,6 +190,7 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
185
190
|
* Rule to enforce consistent newlines before and after dots.
|
186
191
|
*
|
187
192
|
* @since 0.21.0
|
193
|
+
* @deprecated since 8.53.0, please use the [corresponding rule](https://eslint.style/rules/js/dot-location) in `@stylistic/eslint-plugin-js`.
|
188
194
|
* @see https://eslint.org/docs/rules/dot-location
|
189
195
|
*/
|
190
196
|
"dot-location": Linter.RuleEntry<["object" | "property"]>;
|
@@ -417,6 +423,10 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
417
423
|
* @default false
|
418
424
|
*/
|
419
425
|
allowEmptyCase: boolean;
|
426
|
+
/**
|
427
|
+
* @default false
|
428
|
+
*/
|
429
|
+
reportUnusedFallthroughComment: boolean;
|
420
430
|
}>,
|
421
431
|
]
|
422
432
|
>;
|
@@ -425,6 +435,7 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
425
435
|
* Rule to disallow leading or trailing decimal points in numeric literals.
|
426
436
|
*
|
427
437
|
* @since 0.0.6
|
438
|
+
* @deprecated since 8.53.0, please use the [corresponding rule](https://eslint.style/rules/js/no-floating-decimal) in `@stylistic/eslint-plugin-js`.
|
428
439
|
* @see https://eslint.org/docs/rules/no-floating-decimal
|
429
440
|
*/
|
430
441
|
"no-floating-decimal": Linter.RuleEntry<[]>;
|
@@ -601,6 +612,7 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
601
612
|
* Rule to disallow multiple spaces.
|
602
613
|
*
|
603
614
|
* @since 0.9.0
|
615
|
+
* @deprecated since 8.53.0, please use the [corresponding rule](https://eslint.style/rules/js/no-multi-spaces) in `@stylistic/eslint-plugin-js`.
|
604
616
|
* @see https://eslint.org/docs/rules/no-multi-spaces
|
605
617
|
*/
|
606
618
|
"no-multi-spaces": Linter.RuleEntry<
|
@@ -872,6 +884,15 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
872
884
|
*/
|
873
885
|
"no-unused-labels": Linter.RuleEntry<[]>;
|
874
886
|
|
887
|
+
/**
|
888
|
+
* Disallow variable assignments when the value is not used
|
889
|
+
*
|
890
|
+
*
|
891
|
+
* @since 9.0.0-alpha.1
|
892
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-assignment
|
893
|
+
*/
|
894
|
+
"no-useless-assignment": Linter.RuleEntry<[]>;
|
895
|
+
|
875
896
|
/**
|
876
897
|
* Disallow useless backreferences in regular expressions
|
877
898
|
*
|
@@ -1045,12 +1066,21 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
1045
1066
|
"require-await": Linter.RuleEntry<[]>;
|
1046
1067
|
|
1047
1068
|
/**
|
1048
|
-
*
|
1069
|
+
* Enforce the use of `u` or `v` flag on RegExp
|
1049
1070
|
*
|
1050
1071
|
* @since 5.3.0
|
1051
1072
|
* @see https://eslint.org/docs/rules/require-unicode-regexp
|
1052
1073
|
*/
|
1053
|
-
"require-unicode-regexp": Linter.RuleEntry<
|
1074
|
+
"require-unicode-regexp": Linter.RuleEntry<
|
1075
|
+
[
|
1076
|
+
Partial<{
|
1077
|
+
/**
|
1078
|
+
* @default false
|
1079
|
+
*/
|
1080
|
+
requireFlag: "u" | "v";
|
1081
|
+
}>,
|
1082
|
+
]
|
1083
|
+
>;
|
1054
1084
|
|
1055
1085
|
/**
|
1056
1086
|
* Rule to require `var` declarations be placed at the top of their containing scope.
|
@@ -1064,6 +1094,7 @@ export interface BestPractices extends Linter.RulesRecord {
|
|
1064
1094
|
* Rule to require parentheses around immediate `function` invocations.
|
1065
1095
|
*
|
1066
1096
|
* @since 0.0.9
|
1097
|
+
* @deprecated since 8.53.0, please use the [corresponding rule](https://eslint.style/rules/js/wrap-iife) in `@stylistic/eslint-plugin-js`.
|
1067
1098
|
* @see https://eslint.org/docs/rules/wrap-iife
|
1068
1099
|
*/
|
1069
1100
|
"wrap-iife": Linter.RuleEntry<
|