Skip to content

Bug: Build fails on new projects due to incompatibility with eslint@9.29.0 #181

Closed
@dkvc

Description

@dkvc

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

  1. Run pnpm create vue@latest
  2. Select Typescript and ESLint Support.
  3. Run pnpm i. The latest version eslint@9.29.0 will be installed.
  4. 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.

type ConfigItem = TSESLint.FlatConfig.Config
type InfiniteDepthConfigWithExtendsAndVueSupport =
| TsEslintConfigForVue
| ConfigItemWithExtendsAndVueSupport
| InfiniteDepthConfigWithExtendsAndVueSupport[]
interface ConfigItemWithExtendsAndVueSupport extends ConfigItem {
extends?: InfiniteDepthConfigWithExtendsAndVueSupport[]
}

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.

https://github.com/typescript-eslint/typescript-eslint/blob/de8943e98e188d83801ec1044ffc69451db1aa63/packages/utils/src/ts-eslint/Config.ts#L215-L252

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions