Upgrading @eslint/js 8 to 9
Breaking8.57.1 → 9.39.5Breaking38Security3Platform1Deprecated7New118Changed30Fixed158Other789
BreakingUpgrade verdict
36 breaking changes and a platform requirement change and 3 security fixes.
In plain terms
- Code that traversed the AST through other means must now use SourceCode for traversal.
- The no-unused-vars rule now reports unused caught errors by default.
- ESLint and RuleTester now refer to the flat config versions, and the Flat-prefixed names are swapped.
- Rules now default to an empty schema, and rules written as functions are no longer supported.
Must act Top 5 of 47 that need code or config changes
Node.js requirement changed in 9.0.0-alpha.0: ^12.22.0 || ^14.17.0 || >=16.0.0 → ^18.18.0 || ^20.9.0 || >=21.1.0.
What you must change
Breaking36
Moves AST traversal into SourceCode.
SourceCodeChanges the
no-unused-vars default for caughtErrors to 'all'.no-unused-varscaughtErrorsSwaps FlatESLint-ESLint and FlatRuleTester-RuleTester in the API.
FlatESLintESLintFlatRuleTesterRuleTesterSets default
schema: [] and drops support for function-style rules.schemaSwitches Linter to flat config by default.
LinterUpdates shouldUseFlatConfig and CLI so flat config is the default.
shouldUseFlatConfigUpdates the eslint:recommended configuration.
eslint:recommendedDrops support for string configurations in flat config array.
Removes deprecated context methods.
Corrects the
camelcase rule schema for the allow option.camelcaseallowDisallows multiple configuration comments for the same rule.
Rule Tester now checks for missing placeholder data in messages.
RuleTesterChanges the default for
enforceForClassMembers in no-useless-computed-key.no-useless-computed-keyenforceForClassMembersAdds stricter rule test validations.
Allows multiple
no-restricted-imports config entries for the same path.no-restricted-importsDetects duplicate test cases.
Changes
no-inner-declaration default behaviour and adds an option.no-inner-declarationUpgrades eslint-scope to 8.0.0.
eslint-scopeChanges
no-unused-vars varsIgnorePattern behavior with catch arguments.no-unused-varsvarsIgnorePatternConfiguration comments with just severity retain options.
Removes CodePath#currentSegments.
CodePath#currentSegmentsRemoves
no-inner-declarations from eslint:recommended.no-inner-declarationseslint:recommendedSkips running warnings in
--quiet mode.--quietAdds two more cases to the no-implicit-coercion rule.
no-implicit-coercionRemoves the valid-jsdoc and require-jsdoc rules.
valid-jsdocrequire-jsdocChanges CLI behavior when no arguments are passed.
Checks for parsing errors in suggestion fixes.
Makes no-invalid-regexp allowConstructorFlags case-sensitive.
no-invalid-regexpallowConstructorFlagsRemoves SourceCode#getComments().
SourceCode#getComments()Removes formatters except html, json, json-with-metadata, and stylish.
htmljsonjson-with-metadatastylishDrops support for jiti v1.21.
jitiHandles
--output-file for empty output when saving to disk.--output-fileParses the 'exported' comment using parseListConfig.
parseListConfigDeprecates no-new-symbol and recommends no-new-native-nonconstructor.
no-new-symbolno-new-native-nonconstructorAsserts suggestion messages are unique in rule testers.
RuleTesterCorrects the no-sequences rule schema.
no-sequencesSecurity3
Patches a minimatch security vulnerability for the v9.x line.
minimatchUpdates ajv to 6.14.0 to address security vulnerabilities.
ajvBumps @eslint/plugin-kit to 0.3.4 to resolve a vulnerability.
@eslint/plugin-kitPlatform1
Requires Node.js ^18.18.0 || ^20.9.0 || >=21.1.0.
Deprecations to plan for
Deprecated7
Marks deprecated rules as available until v11.0.0.
Marks deprecated formatting rules as available until v11.0.0.
Disallows use of the deprecated type property in core rule tests.
typeRemoves the deprecated type property from core rule tests.
typeDocuments deprecation of indent, quotes and semi rule types.
indentquotessemiMarks
LintMessage#nodeType as deprecated.LintMessage#nodeTypeDeprecates the
multiline-comment-style and line-comment-position rules.multiline-comment-styleline-comment-position