Description
Error
This issue affects all new Vue projects created with the standard scaffolding (pnpm create vue@latest
) since the release of eslint@9.29.0
. It can also be reproduced on existing projects by updating eslint
from 9.28.0
to 9.29.0
The default eslint.config.ts
generated by create-vue
now fails during the vue-tsc --build
step with a TS2345
type error.
Possible Cause
The API contract of defineConfigWithVueTs
appears to be broken by the eslint@9.29.0
release. The function expects a very specific object shape, but helper functions from the eslint
package itself now return objects that no longer match that shape.
Here's the commit that contains the changes to FlatConfig
in eslint
: eslint/eslint@7ab77a2
Reproducing the Bug
- Run
pnpm create vue@latest
- Select Typescript and ESLint Support.
- Run
pnpm i
. The latest versioneslint@9.29.0
will be installed. - Run
pnpm build
.
Error Log
eslint.config.ts:18:3 - error TS2345: Argument of type 'Config<RulesRecord>' is not assignable to parameter of type 'InfiniteDepthConfigWithExtendsAndVueSupport'.
Type 'Config<RulesRecord>' is not assignable to type 'ConfigItemWithExtendsAndVueSupport'.
Types of property 'languageOptions' are incompatible.
Type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/eslint@9.29.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.LanguageOptions | undefined' is not assignable to type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.29.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions | undefined'.
Type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/eslint@9.29.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.LanguageOptions' is not assignable to type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.29.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions'.
Types of property 'ecmaVersion' are incompatible.
Type 'EcmaVersion | undefined' is not assignable to type 'EcmaVersion'.
Type '17' is not assignable to type 'EcmaVersion'.
18 globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notes/Assumptions
I assume this is a type incompatibility between eslint
and @typescript-eslint/utils.
eslint-config-typescript/src/utilities.ts
Lines 17 to 24 in 0a6480d
Here, ConfigItemWithExtendsAndVueSupport
depends on ConfigItem
, which further depends on TSESLint.FlatConfig.Config
. Based on the error log, it appears LanguageOptions
from @typescript-eslint/utils
requires changes.