This release updates the @eslint/plugin-kit
dependency to the latest version 0.2.3 which includes the fix for security advisory GHSA-7q7g-4xm8-89cq.
Highlights
meta.defaultOptions
Rules can now specify default options. ESLint will recursively merge any user-provided options elements on top of the default elements.
This feature makes it easier to work with options in rules.
// my-rule.js
export default {
meta: {
defaultOptions: [{
alias: "basic",
ignoreClassFields: false
}],
schema: [{
type: "object",
properties: {
alias: {
type: "string"
},
ignoreClassFields: {
type: "boolean"
}
},
additionalProperties: false
}]
},
create(context) {
// `context.options` is guaranteed to be an array with a single object
// that has a string property `alias` and a boolean property `ignoreClassFields`.
// If the rule is enabled with no options specified in the configuration file,
// `alias` will be `"basic"`, and `ignoreClassFields` will be `false`.
const [{ alias, ignoreClassFields }] = context.options;
return { /* ... */ };
}
};
This feature also allows document generators, other tools and integrations, and end users to easily find the default options for rules.
Other notable changes
- Custom languages can now provide the
normalizeLanguageOptions(languageOptions)
method. The return value will be used aslanguageOptions
when callingparse()
,createSourceCode()
, andapplyLanguageOptions()
methods and as the value ofcontext.languageOptions
property in rules. - The
no-useless-computed-key
rule now fully supports object destructuring patterns.
Features
01557ce
feat: Implement Language#normalizeLanguageOptions() (#19104) (Nicholas C. Zakas)2edc0e2
feat: add meta.defaultOptions (#17656) (Josh Goldberg ✨)bdec50e
feat: fixno-useless-computed-key
false negative with__proto__
(#19123) (Milos Djermanovic)3087c9e
feat: addmeta
object to@eslint/js
plugin (#19095) (Francesco Trotta)
Bug Fixes
fd33f13
fix: update types forno-restricted-imports
rule (#19060) (Nitin Kumar)bd35098
fix: switch away from Node.js node:assert and AssertionError (#19082) (Josh Goldberg ✨)9db5b15
fix: unsafe report forno-lonely-if
(#19087) (Abraham Guo)68fa497
fix: ignore files on a different drive on Windows (#19069) (Francesco Trotta)4ce625a
fix: upgrade @humanwhocodes/retry@0.4.1 to avoid debug logs (#19102) (Milos Djermanovic)
Documentation
d927920
docs: fix styles in no-js mode (#18916) (Tanuj Kanti)09bc2a8
docs: Update README (GitHub Actions Bot)39089c8
docs: addno-useless-computed-key
examples with object patterns (#19109) (Milos Djermanovic)895c60f
docs: add missing messageId property and suggestion properties (#19122) (fnx)298625e
docs: Change CLI -c to use flat config (#19103) (Nicholas C. Zakas)522d8a3
docs: add deprecation onindent
,quotes
andsemi
rule types (#19090) (Marco Pasqualetti)
Chores
2967d91
chore: upgrade @eslint/js@9.15.0 (#19133) (Milos Djermanovic)b441bee
chore: package.json update for @eslint/js release (Jenkins)7d6bf4a
chore: upgrade @eslint/core@0.9.0 (#19131) (Milos Djermanovic)902e707
chore: upgrade @eslint/plugin-kit@0.2.3 (#19130) (Milos Djermanovic)5ff6c1d
chore: bump cross-spawn (#19125) (Ian Bobinac)cceccc7
chore: update dependency @eslint/json to ^0.6.0 (#19117) (renovate[bot])0da3f73
chore: update algolia referrer (#19114) (Strek)4f08332
ci: unpintrunk-io/trunk-action
(#19108) (Francesco Trotta)6b75683
perf: optimizetext-table
by replacing regex withtrimEnd
(#19061) (Nitin Kumar)