Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

eslint

Package Overview
Dependencies
Maintainers
2
Versions
412
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint - npm Package Compare versions

Comparing version
10.0.0-rc.2
to
10.0.0
+29
-12
lib/rules/array-callback-return.js

@@ -55,3 +55,3 @@ /**

function fullMethodName(arrayMethodName) {
if (["from", "of", "isArray"].includes(arrayMethodName)) {
if (["from", "fromAsync", "of", "isArray"].includes(arrayMethodName)) {
return "Array.".concat(arrayMethodName);

@@ -65,2 +65,3 @@ }

* callback of an array method, returning the method name.
* Generators are excluded. Async functions are allowed only for `Array.fromAsync`.
* @param {ASTNode} node A node to check. This is one of

@@ -72,2 +73,6 @@ * FunctionExpression or ArrowFunctionExpression.

function getArrayMethodName(node) {
// Generators are not checked for any methods.
if (node.generator) {
return null;
}
let currentNode = node;

@@ -113,3 +118,23 @@

case "CallExpression":
if (astUtils.isArrayFromMethod(parent.callee)) {
if (!node.async) {
if (astUtils.isArrayFromMethod(parent.callee)) {
if (
parent.arguments.length >= 2 &&
parent.arguments[1] === currentNode
) {
return "from";
}
}
if (isTargetMethod(parent.callee)) {
if (
parent.arguments.length >= 1 &&
parent.arguments[0] === currentNode
) {
return astUtils.getStaticPropertyName(
parent.callee,
);
}
}
}
if (astUtils.isArrayFromAsyncMethod(parent.callee)) {
if (

@@ -119,13 +144,5 @@ parent.arguments.length >= 2 &&

) {
return "from";
return "fromAsync";
}
}
if (isTargetMethod(parent.callee)) {
if (
parent.arguments.length >= 1 &&
parent.arguments[0] === currentNode
) {
return astUtils.getStaticPropertyName(parent.callee);
}
}
return null;

@@ -402,3 +419,3 @@

hasReturn: false,
shouldCheck: methodName && !node.async && !node.generator,
shouldCheck: !!methodName,
node,

@@ -405,0 +422,0 @@ currentSegments: new Set(),

@@ -44,2 +44,3 @@ /**

"globalThis",
"self",
]);

@@ -46,0 +47,0 @@ const EVAL_LIKE_FUNC_PATTERN =

@@ -57,3 +57,3 @@ /**

this.emitWarning(
'The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files',
'The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files',
"ESLintIgnoreWarning",

@@ -60,0 +60,0 @@ );

@@ -30,4 +30,2 @@ /**

import type {
CustomRuleDefinitionType,
CustomRuleTypeDefinitions,
DeprecatedInfo,

@@ -76,15 +74,9 @@ LanguageOptions as GenericLanguageOptions,

} from "@eslint/core";
import type {
CustomRuleDefinitionType,
CustomRuleTypeDefinitions,
CustomRuleVisitorWithExit,
} from "@eslint/plugin-kit";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/** Adds matching `:exit` selectors for all properties of a `RuleVisitor`. */
type WithExit<RuleVisitorType extends RuleVisitor> = {
[Key in keyof RuleVisitorType as
| Key
| `${Key & string}:exit`]: RuleVisitorType[Key];
};
//------------------------------------------------------------------------------
// Exports

@@ -678,3 +670,3 @@ //------------------------------------------------------------------------------

interface NodeListener
extends WithExit<
extends CustomRuleVisitorWithExit<
{

@@ -681,0 +673,0 @@ [Node in Rule.Node as Node["type"]]?:

@@ -17,3 +17,3 @@ "use strict";

* If the file is ignored because no matching configuration was supplied, check file patterns in your config file.
https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-with-arbitrary-extensions
https://eslint.org/docs/latest/use/configure/configuration-files#specify-files-with-arbitrary-extensions

@@ -20,0 +20,0 @@ * If the file is ignored because it is located outside of the base path, change the location of your config file to be in a parent directory.

@@ -12,6 +12,6 @@ "use strict";

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
https://eslint.org/docs/latest/use/configure/migration-guide#configure-language-options
If you're not using "env" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -28,3 +28,3 @@

If you're not using "extends" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -38,6 +38,6 @@

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
https://eslint.org/docs/latest/use/configure/migration-guide#configure-language-options
If you're not using "globals" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -51,6 +51,6 @@

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files
If you're not using "ignorePatterns" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -76,3 +76,3 @@

If you're not using "overrides" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -89,3 +89,3 @@

If you're not using "parser" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -99,6 +99,6 @@

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
https://eslint.org/docs/latest/use/configure/migration-guide#configure-language-options
If you're not using "parserOptions" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

@@ -105,0 +105,0 @@

@@ -22,7 +22,7 @@ "use strict";

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#importing-plugins-and-custom-parsers
https://eslint.org/docs/latest/use/configure/migration-guide#import-plugins-and-custom-parsers
If you're using a shareable config that you cannot rewrite in flat config format, then use the compatibility utility:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`;
};

@@ -15,4 +15,4 @@ "use strict";

See https://eslint.org/docs/latest/use/configure/rules#using-configuration-files for configuring rules.
See https://eslint.org/docs/latest/use/configure/rules#use-configuration-files for configuring rules.
`.trimStart();
};

@@ -11,4 +11,4 @@ "use strict";

See https://eslint.org/docs/latest/use/configure/rules#using-configuration-files for configuring rules.
See https://eslint.org/docs/latest/use/configure/rules#use-configuration-files for configuring rules.
`.trimStart();
};
{
"name": "eslint",
"version": "10.0.0-rc.2",
"version": "10.0.0",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",

@@ -112,5 +112,5 @@ "description": "An AST-based pattern checker for JavaScript.",

"@eslint/config-array": "^0.23.0",
"@eslint/config-helpers": "^0.5.1",
"@eslint/core": "^1.0.1",
"@eslint/plugin-kit": "^0.5.1",
"@eslint/config-helpers": "^0.5.2",
"@eslint/core": "^1.1.0",
"@eslint/plugin-kit": "^0.6.0",
"@humanfs/node": "^0.16.6",

@@ -151,3 +151,3 @@ "@humanwhocodes/module-importer": "^1.0.1",

"@types/node": "^22.13.14",
"@typescript-eslint/parser": "file:tools/typescript-eslint-parser",
"@typescript-eslint/parser": "^8.54.0",
"babel-loader": "^8.0.5",

@@ -154,0 +154,0 @@ "c8": "^7.12.0",

@@ -355,3 +355,3 @@ [![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint)

<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>
<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>
<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://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" 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://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="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>

@@ -358,0 +358,0 @@ 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.

Sorry, the diff of this file is too big to display