chore: migrate the ESLint config to defineConfig#3818
Merged
Conversation
typescript-eslint 8.62 deprecated its `tseslint.config()` helper and retyped `tseslint.configs.*` as loose cross-version "compatibility" shapes (`CompatibleConfig`), which the deprecated helper's `InfiniteDepthConfigWithExtends` parameter no longer accepts — the config file lights up with type errors in the IDE. Switch to ESLint core's `defineConfig()` (the replacement the deprecation notice points to) and give the two remaining untyped values one documented assertion each: - the internal @AstryX plugin (intentionally untyped JS) is asserted to `ESLint.Plugin` once and reused by every `plugins` entry - `tseslint.configs.recommended` is normalized back from `CompatibleConfig[]` to `Linter.Config[]` The resolved config is unchanged: `eslint --print-config` output for core (.tsx) and CLI (.mjs) files is byte-identical before/after, in both human and CI strict modes.
Han5991
requested review from
cixzhang,
ejhammond,
imdreamrunner,
josephfarina,
marie-lucas,
nynexman4464 and
thedjpetersen
as code owners
July 11, 2026 13:02
|
The latest updates on your projects. Learn more about Vercel 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.
Problem
eslint.config.jsshows type errors in the IDE:Root cause: typescript-eslint 8.62 deprecated the
tseslint.config()helper in favor of ESLint core'sdefineConfig(), and at the same time retypedtseslint.configs.*as loose cross-version "compatibility" shapes (CompatibleConfig={name?, rules?: object}). Those loose shapes no longer satisfy the deprecated helper's ownInfiniteDepthConfigWithExtendsparameter, so feeding typescript-eslint's presets into its ownconfig()helper now fails to type-check.Fix
export default tseslint.config(...)→defineConfig(...)fromeslint/config, the replacement the deprecation notice points to.defineConfigtype-checkspluginsagainst ESLint core's stricterPlugintype, which the internal@astryxplugin (intentionally untyped JS, excluded from the lint surface) doesn't satisfy structurally. One documented assertion creates a typed alias that all threepluginsentries reuse.tseslint.configs.recommendedis normalized fromCompatibleConfig[]back toLinter.Config[]with a documented assertion, keeping the preset spread type-clean.Verification
tsc(strict, checkJs) oneslint.config.js: clean before and after the plugin typing fix was needed; clean now.eslint --print-configcompared for a core.tsxfile and a CLI.mjsfile, in both human mode andCI=truestrict mode — no diff.eslintruns clean on representative files with the new config.