Comparing version 9.10.0 to 9.11.0
@@ -68,9 +68,5 @@ /** | ||
function getRuleFromConfig(ruleId, config) { | ||
const { pluginName, ruleName } = parseRuleId(ruleId); | ||
const plugin = config.plugins && config.plugins[pluginName]; | ||
const rule = plugin && plugin.rules && plugin.rules[ruleName]; | ||
return rule; | ||
return config.plugins?.[pluginName]?.rules?.[ruleName]; | ||
} | ||
@@ -77,0 +73,0 @@ |
@@ -23,3 +23,3 @@ /** | ||
createEmitter = require("../../../linter/safe-emitter"), | ||
{ ConfigCommentParser, VisitNodeStep, CallMethodStep } = require("@eslint/plugin-kit"), | ||
{ ConfigCommentParser, VisitNodeStep, CallMethodStep, Directive } = require("@eslint/plugin-kit"), | ||
@@ -320,53 +320,2 @@ eslintScope = require("eslint-scope"); | ||
/** | ||
* A class to represent a directive comment. | ||
* @implements {IDirective} | ||
*/ | ||
class Directive { | ||
/** | ||
* The type of directive. | ||
* @type {"disable"|"enable"|"disable-next-line"|"disable-line"} | ||
* @readonly | ||
*/ | ||
type; | ||
/** | ||
* The node representing the directive. | ||
* @type {ASTNode|Comment} | ||
* @readonly | ||
*/ | ||
node; | ||
/** | ||
* Everything after the "eslint-disable" portion of the directive, | ||
* but before the "--" that indicates the justification. | ||
* @type {string} | ||
* @readonly | ||
*/ | ||
value; | ||
/** | ||
* The justification for the directive. | ||
* @type {string} | ||
* @readonly | ||
*/ | ||
justification; | ||
/** | ||
* Creates a new instance. | ||
* @param {Object} options The options for the directive. | ||
* @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive. | ||
* @param {ASTNode|Comment} options.node The node representing the directive. | ||
* @param {string} options.value The value of the directive. | ||
* @param {string} options.justification The justification for the directive. | ||
*/ | ||
constructor({ type, node, value, justification }) { | ||
this.type = type; | ||
this.node = node; | ||
this.value = value; | ||
this.justification = justification; | ||
} | ||
} | ||
//------------------------------------------------------------------------------ | ||
@@ -373,0 +322,0 @@ // Public Interface |
@@ -89,2 +89,9 @@ /** | ||
/** | ||
* The raw body of the file, including a BOM if present. | ||
* @type {string|Uint8Array} | ||
* @readonly | ||
*/ | ||
rawBody; | ||
/** | ||
* Indicates whether the file has a byte order mark (BOM). | ||
@@ -108,6 +115,6 @@ * @type {boolean} | ||
this.body = stripUnicodeBOM(body); | ||
this.rawBody = body; | ||
} | ||
} | ||
module.exports = { VFile }; |
@@ -14,2 +14,3 @@ /** | ||
const { getGraphemeCount } = require("../shared/string-utils"); | ||
const { getModuleExportName } = require("./utils/ast-utils"); | ||
@@ -120,2 +121,8 @@ //------------------------------------------------------------------------------ | ||
}, | ||
ImportSpecifier(parent, node) { | ||
return ( | ||
parent.local === node && | ||
getModuleExportName(parent.imported) !== getModuleExportName(parent.local) | ||
); | ||
}, | ||
ImportDefaultSpecifier: true, | ||
@@ -122,0 +129,0 @@ ImportNamespaceSpecifier: true, |
@@ -7,2 +7,4 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
//------------------------------------------------------------------------------ | ||
@@ -147,6 +149,9 @@ // Helpers | ||
hasSuggestions: true, | ||
schema: [], | ||
messages: { | ||
noUselessConstructor: "Useless constructor." | ||
noUselessConstructor: "Useless constructor.", | ||
removeConstructor: "Remove the constructor." | ||
} | ||
@@ -182,3 +187,14 @@ }, | ||
node, | ||
messageId: "noUselessConstructor" | ||
messageId: "noUselessConstructor", | ||
suggest: [ | ||
{ | ||
messageId: "removeConstructor", | ||
*fix(fixer) { | ||
const nextToken = context.sourceCode.getTokenAfter(node); | ||
const addSemiColon = nextToken.type === "Punctuator" && nextToken.value === "[" && astUtils.needsPrecedingSemicolon(context.sourceCode, node); | ||
yield fixer.replaceText(node, addSemiColon ? ";" : ""); | ||
} | ||
} | ||
] | ||
}); | ||
@@ -185,0 +201,0 @@ } |
@@ -248,4 +248,4 @@ /** | ||
* @param {LintResult[]} results The list of linting results. | ||
* @param {{cwd: string, maxWarningsExceeded?: MaxWarningsExceeded, rulesMeta: Record<string, RuleMeta>}} [context] A context object. | ||
* @param {{cwd: string, maxWarningsExceeded?: MaxWarningsExceeded, rulesMeta: Record<string, RuleMeta>}} context A context object. | ||
* @returns {string | Promise<string>} Formatted text. | ||
*/ |
@@ -327,2 +327,4 @@ /** | ||
| "constructors" | ||
| "asyncFunctions" | ||
| "asyncMethods" | ||
>; | ||
@@ -476,3 +478,3 @@ }>, | ||
*/ | ||
allow: Array<"~" | "!!" | "+" | "*">; | ||
allow: Array<"~" | "!!" | "+" | "- -" | "-" | "*">; | ||
}>, | ||
@@ -688,12 +690,18 @@ ] | ||
[ | ||
Partial<{ | ||
/** | ||
* @default false | ||
*/ | ||
props: boolean; | ||
/** | ||
* @default [] | ||
*/ | ||
ignorePropertyModificationsFor: string[]; | ||
}>, | ||
| { | ||
props?: false; | ||
} | ||
| ({ | ||
props: true; | ||
} & Partial<{ | ||
/** | ||
* @default [] | ||
*/ | ||
ignorePropertyModificationsFor: string[]; | ||
/** | ||
* @since 6.6.0 | ||
* @default [] | ||
*/ | ||
ignorePropertyModificationsForRegex: string[]; | ||
}>), | ||
] | ||
@@ -972,3 +980,3 @@ >; | ||
* | ||
* @since 3.5.0 | ||
* @since 8.5.0 | ||
* @see https://eslint.org/docs/rules/prefer-object-has-own | ||
@@ -975,0 +983,0 @@ */ |
@@ -235,2 +235,48 @@ /** | ||
/** | ||
* Rule to disallow specified names in exports. | ||
* | ||
* @since 7.0.0-alpha.0 | ||
* @see https://eslint.org/docs/rules/no-restricted-exports | ||
*/ | ||
"no-restricted-exports": Linter.RuleEntry< | ||
[ | ||
Partial<{ | ||
/** | ||
* @default [] | ||
*/ | ||
restrictedNamedExports: string[]; | ||
/** | ||
* @since 9.3.0 | ||
*/ | ||
restrictedNamedExportsPattern: string; | ||
/** | ||
* @since 8.33.0 | ||
*/ | ||
restrictDefaultExports: Partial<{ | ||
/** | ||
* @default false | ||
*/ | ||
direct: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
named: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
defaultFrom: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
namedFrom: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
namespaceFrom: boolean; | ||
}>; | ||
}>, | ||
] | ||
>; | ||
/** | ||
* Rule to disallow specified modules when loaded by `import`. | ||
@@ -237,0 +283,0 @@ * |
@@ -254,3 +254,26 @@ /** | ||
*/ | ||
"no-extra-boolean-cast": Linter.RuleEntry<[]>; | ||
"no-extra-boolean-cast": Linter.RuleEntry< | ||
[ | ||
| Partial<{ | ||
/** | ||
* @since 9.3.0 | ||
* @default false | ||
*/ | ||
enforceForInnerExpressions: boolean; | ||
/** | ||
* @deprecated | ||
*/ | ||
enforceForLogicalOperands: never; | ||
}> | ||
| Partial<{ | ||
/** | ||
* @deprecated | ||
* @since 7.0.0-alpha.2 | ||
* @default false | ||
*/ | ||
enforceForLogicalOperands: boolean; | ||
enforceForInnerExpressions: never; | ||
}>, | ||
] | ||
>; | ||
@@ -395,3 +418,13 @@ /** | ||
*/ | ||
"no-misleading-character-class": Linter.RuleEntry<[]>; | ||
"no-misleading-character-class": Linter.RuleEntry< | ||
[ | ||
Partial<{ | ||
/** | ||
* @since 9.3.0 | ||
* @default false | ||
*/ | ||
allowEscape: boolean; | ||
}>, | ||
] | ||
>; | ||
@@ -398,0 +431,0 @@ /** |
@@ -169,2 +169,12 @@ /** | ||
/** | ||
* @since 6.7.0 | ||
* @default false | ||
*/ | ||
ignoreImports: boolean; | ||
/** | ||
* @since 7.4.0 | ||
* @default false | ||
*/ | ||
ignoreGlobals: boolean; | ||
/** | ||
* @remarks | ||
@@ -171,0 +181,0 @@ * Also accept for regular expression patterns |
{ | ||
"name": "eslint", | ||
"version": "9.10.0", | ||
"version": "9.11.0", | ||
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>", | ||
@@ -23,2 +23,6 @@ "description": "An AST-based pattern checker for JavaScript.", | ||
"types": "./lib/types/rules/index.d.ts" | ||
}, | ||
"./universal": { | ||
"types": "./lib/types/universal.d.ts", | ||
"default": "./lib/universal.js" | ||
} | ||
@@ -40,3 +44,4 @@ }, | ||
"release:generate:beta": "node Makefile.js generatePrerelease -- beta", | ||
"release:generate:latest": "node Makefile.js generateRelease", | ||
"release:generate:latest": "node Makefile.js generateRelease -- latest", | ||
"release:generate:maintenance": "node Makefile.js generateRelease -- maintenance", | ||
"release:generate:rc": "node Makefile.js generatePrerelease -- rc", | ||
@@ -86,4 +91,4 @@ "release:publish": "node Makefile.js publishRelease", | ||
"@eslint/eslintrc": "^3.1.0", | ||
"@eslint/js": "9.10.0", | ||
"@eslint/plugin-kit": "^0.1.0", | ||
"@eslint/js": "9.11.0", | ||
"@eslint/plugin-kit": "^0.2.0", | ||
"@humanwhocodes/module-importer": "^1.0.1", | ||
@@ -121,3 +126,3 @@ "@humanwhocodes/retry": "^0.3.0", | ||
"@babel/preset-env": "^7.4.3", | ||
"@eslint/core": "^0.5.0", | ||
"@eslint/core": "^0.6.0", | ||
"@eslint/json": "^0.4.0", | ||
@@ -128,2 +133,3 @@ "@trunkio/launcher": "^1.3.0", | ||
"@types/node": "^20.11.5", | ||
"@typescript-eslint/parser": "^8.4.0", | ||
"@wdio/browser-runner": "^9.0.5", | ||
@@ -143,4 +149,5 @@ "@wdio/cli": "^9.0.5", | ||
"eslint-plugin-eslint-plugin": "^6.0.0", | ||
"eslint-plugin-expect-type": "^0.4.0", | ||
"eslint-plugin-yml": "^1.14.0", | ||
"eslint-release": "^3.2.2", | ||
"eslint-release": "^3.3.0", | ||
"eslint-rule-composer": "^0.3.0", | ||
@@ -147,0 +154,0 @@ "eslump": "^3.0.0", |
@@ -300,5 +300,5 @@ [![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint) | ||
<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> | ||
<p><a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://opensource.siemens.com"><img src="https://avatars.githubusercontent.com/u/624020?v=4" alt="Siemens" height="96"></a></p><h3>Silver Sponsors</h3> | ||
<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> | ||
<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> | ||
<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="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.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" 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> | ||
<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="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://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> | ||
<!--sponsorsend--> | ||
@@ -305,0 +305,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3297399
419
78852
65
+ Added@eslint/js@9.11.0(transitive)
+ Added@eslint/plugin-kit@0.2.2(transitive)
+ Addedeslint-scope@8.1.0(transitive)
+ Addedeslint-visitor-keys@4.1.0(transitive)
+ Addedespree@10.2.0(transitive)
- Removed@eslint/js@9.10.0(transitive)
- Removed@eslint/plugin-kit@0.1.0(transitive)
- Removedeslint-scope@8.2.0(transitive)
- Removedeslint-visitor-keys@4.2.0(transitive)
- Removedespree@10.3.0(transitive)
Updated@eslint/js@9.11.0
Updated@eslint/plugin-kit@^0.2.0