Migrate to ESLint v9#28
Open
AlbertSmit wants to merge 2 commits into
Open
Conversation
…test suites accordingly
|
Important Review skippedToo many files! This PR contains 203 files, which is 53 over the limit of 150. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (203)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate
@kaliber/eslint-pluginto ESLint v9 (Flat Config)Why v9 and not v10?
ESLint v10 (released Feb 2026) completely removes the legacy
eslintrcconfiguration system — flat config is the only option. While that's ultimately where we want to be, jumping straight to v10 carries too much risk for our consuming projects:eslintrcformat, meaning consumer projects that still use.eslintrc(all of them, currently) would break immediately upon upgrading.eslintrcvia theESLINT_USE_FLAT_CONFIG=falseflag. This gives us a transition period where the plugin is fully flat-config-ready, while consumer projects can migrate at their own pace.In short: v9 is the bridge release. We modernize the plugin now, and consumers can adopt flat config on their own timeline — after which upgrading to v10 becomes trivial.
What changed
Configuration format:
.eslintrc→eslint.config.jsThe old JSON-based
.eslintrchas been deleted and replaced witheslint.config.js— an array of config objects (flat config). This is the config that consumer projects import:Plugin structure:
metaobjectThe plugin entry point (
index.js) now exports a propermetaobject withnameandversion, as required by ESLint v9's plugin API.Deprecated stylistic rules →
@stylistic/eslint-pluginESLint v9 deprecated all built-in formatting/stylistic rules (
indent,quotes,semi,brace-style, etc.). These have been migrated to@stylistic/eslint-plugin, the official community-maintained successor:@stylistic/)semi@stylistic/semiquotes@stylistic/quotesindent@stylistic/indentno-mixed-operators@stylistic/no-mixed-operatorsAll rule options and behavior are preserved — only the namespace changed.
Deprecated/renamed core rules
Several core rules were renamed or replaced in v9:
no-new-objectno-object-constructorno-new-symbolno-new-native-nonconstructorno-native-reassignno-global-assign(already existed)no-negated-in-lhsno-unsafe-negation(already existed)no-return-await@typescript-eslint)jsx-a11y/accessible-emojijsx-a11y/scopePlugin swap:
eslint-plugin-import→eslint-plugin-import-xThe original
eslint-plugin-importdoes not support flat config. We've switched toeslint-plugin-import-x, a maintained fork with full ESLint v9 compatibility. Rule names use theimport-x/prefix.API changes in custom rules
ESLint v9 deprecated several
contextmethods used in our custom rules:context.getFilename()context.filenamecontext.getScope()sourceCode.getScope(node)These changes affect
machinery/ast.jsandmachinery/filename.js.RuleTester configuration
All test files have been updated to use the new
languageOptionsformat:Self-linting
Added
eslint.self.config.js— a minimal config for linting the plugin's own source code, along withlintandlint:fixnpm scripts. Cleaned up all semicolons and trailing whitespace across the codebase.Globals
The
envproperty (browser,node,jest, etc.) has been replaced with explicitglobalsfrom theglobalspackage underlanguageOptions.globals.New dependencies
@eslint/jsjs.configs.recommendedfor flat config@stylistic/eslint-plugineslint-plugin-import-xeslint-plugin-importglobalsenv)Test status
no-extra-label,no-iterator,no-new-object,no-new-symbol,no-proto(renamed/removed core rules)import/export(import-x compatibility)react/jsx-pascal-case(test fixture issue)Breaking changes for consumers
.eslintrcextending./node_modules/@kaliber/eslint-plugin/.eslintrcto aneslint.config.jsimporting the flat config array.