Skip to content

refactor: migrate eslint.config to TypeScript - #3292

Open
ValentinYoushkevich wants to merge 2 commits into
vuejs:masterfrom
ValentinYoushkevich:chore/eslint-config-ts
Open

ValentinYoushkevich wants to merge 2 commits into
vuejs:masterfrom
ValentinYoushkevich:chore/eslint-config-ts

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

Part of #2777. As Flo suggested there, this converts the repo's own eslint.config.mjs to TypeScript. ESLint 10 still loads .ts configs through jiti unless the unstable_native_nodejs_ts_config flag is passed on every run, so jiti is added as a dev dependency and npm run lint, plain npx eslint and editor integrations keep working without flags. jiti can return half-evaluated modules when one module is imported concurrently (unjs/jiti#484), which broke the wrapper rules that tools/lib/rules.ts imported in parallel, so it now imports them one by one. --print-config for sample files and the eslint . output are unchanged. The config stays out of tsconfig.json because the typings/eslint path mapping clashes with ESLint 10's config types.

@changeset-bot

changeset-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d6da96f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@FloEdelmann FloEdelmann added the meta Code style improvements, build process improvements, refactorings label Nov 30, 2026
Comment thread tools/lib/rules.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this called via Jiti at all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, eslint.config.ts imports it, and when ESLint loads the config through jiti, jiti also loads everything the config imports, including this file and the rule modules it imports. With the parallel imports from master, eslint fails right away with TypeError: _index.default.wrapStylisticOrCoreRule is not a function at lib/rules/array-bracket-spacing.ts, thrown from inside jiti.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Code style improvements, build process improvements, refactorings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants