eslint 10.0.0-rc.1 → 10.0.0-rc.2
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 +10 -1
- package/lib/rules/strict.js +11 -1
- package/lib/unsupported-api.js +1 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
|
|
|
35
35
|
1. [Releases](#releases)
|
|
36
36
|
1. [Security Policy](#security-policy)
|
|
37
37
|
1. [Semantic Versioning Policy](#semantic-versioning-policy)
|
|
38
|
+
1. [ESM Dependencies](#esm-dependencies)
|
|
38
39
|
1. [License](#license)
|
|
39
40
|
1. [Team](#team)
|
|
40
41
|
1. [Sponsors](#sponsors)
|
|
@@ -203,6 +204,14 @@ ESLint follows [semantic versioning](https://semver.org). However, due to the na
|
|
|
203
204
|
|
|
204
205
|
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.
|
|
205
206
|
|
|
207
|
+
## ESM Dependencies
|
|
208
|
+
|
|
209
|
+
Since ESLint is a CommonJS package, there are restrictions on which ESM-only packages can be used as dependencies.
|
|
210
|
+
|
|
211
|
+
Packages that are controlled by the ESLint team and have no external dependencies can be safely loaded synchronously using [`require(esm)`](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require) and therefore used in any contexts.
|
|
212
|
+
|
|
213
|
+
For external packages, we don't use `require(esm)` because a package could add a top-level `await` and thus break ESLint. We can use an external ESM-only package only in case it is needed only in asynchronous code, in which case it can be loaded using dynamic `import()`.
|
|
214
|
+
|
|
206
215
|
## License
|
|
207
216
|
|
|
208
217
|
MIT License
|
|
@@ -343,7 +352,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
|
|
343
352
|
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
|
|
344
353
|
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
|
345
354
|
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
|
346
|
-
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" 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" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
|
355
|
+
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" 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" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
|
347
356
|
<h3>Technology Sponsors</h3>
|
|
348
357
|
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.
|
|
349
358
|
<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>
|
package/lib/rules/strict.js
CHANGED
|
@@ -268,6 +268,7 @@ module.exports = {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
/** @type {import('../types').Rule.RuleListener} */
|
|
271
272
|
const rule = {
|
|
272
273
|
Program(node) {
|
|
273
274
|
const useStrictDirectives = getUseStrictDirectives(node.body);
|
|
@@ -281,7 +282,16 @@ module.exports = {
|
|
|
281
282
|
node.body.length > 0 &&
|
|
282
283
|
useStrictDirectives.length === 0
|
|
283
284
|
) {
|
|
284
|
-
|
|
285
|
+
/*
|
|
286
|
+
* Report the range as v9 does
|
|
287
|
+
*/
|
|
288
|
+
context.report({
|
|
289
|
+
loc: {
|
|
290
|
+
start: node.body[0].loc.start,
|
|
291
|
+
end: node.body.at(-1).loc.end,
|
|
292
|
+
},
|
|
293
|
+
messageId: "global",
|
|
294
|
+
});
|
|
285
295
|
}
|
|
286
296
|
reportAllExceptFirst(useStrictDirectives, "multiple", true);
|
|
287
297
|
} else {
|
package/lib/unsupported-api.js
CHANGED
|
@@ -18,9 +18,4 @@ const builtinRules = require("./rules");
|
|
|
18
18
|
// Exports
|
|
19
19
|
//-----------------------------------------------------------------------------
|
|
20
20
|
|
|
21
|
-
module.exports = {
|
|
22
|
-
builtinRules,
|
|
23
|
-
FlatESLint: null,
|
|
24
|
-
LegacyESLint: null,
|
|
25
|
-
shouldUseFlatConfig,
|
|
26
|
-
};
|
|
21
|
+
module.exports = { builtinRules, shouldUseFlatConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.2",
|
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"eslint-scope": "^9.1.0",
|
|
124
124
|
"eslint-visitor-keys": "^5.0.0",
|
|
125
125
|
"espree": "^11.1.0",
|
|
126
|
-
"esquery": "^1.
|
|
126
|
+
"esquery": "^1.7.0",
|
|
127
127
|
"esutils": "^2.0.2",
|
|
128
128
|
"fast-deep-equal": "^3.1.3",
|
|
129
129
|
"file-entry-cache": "^8.0.0",
|