vuejs/eslint-config-typescript

defineConfigWithVueTs does not accept common ESLint fields like files or name

Closed this issue · 4 comments

Bug Report

When trying to pass standard FlatConfig fields such as files and name into defineConfigWithVueTs, I get a TypeScript error stating these properties are not allowed.
The default eslint.config.ts generated by bun create vue@latest now fails during the bun run build step with a TS2353 type error.

Error Log

Object literal may only specify known properties, and 'files' does not exist in type 'InfiniteDepthConfigWithExtendsAndVueSupport'.

Expected

Since defineConfigWithVueTs seems to behave like defineFlatConfig, it should accept standard ESLint flat config fields such as files, name, etc.

Reproducing the Bug

  1. Run bun create vue@latest
  2. Select Typescript and ESLint Support.
  3. Run bun install. The latest version eslint@9.32.0 will be installed.
  4. Run bun run build.

My Config

eslint.config.ts:

import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'

export default defineConfigWithVueTs(
  {
    name: 'app/files-to-lint',
    files: ['**/*.{ts,mts,tsx,vue}'],
  },

  globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),

  pluginVue.configs['flat/essential'],
  vueTsConfigs.recommended,
  skipFormatting,
)

package.json:

  "name": "frontend-vue-migrate",
  "version": "0.0.0",
  "private": true,
  "type": "module",
  "engines": {
    "node": "^20.19.0 || >=22.12.0"
  },
  "scripts": {
    "dev": "vite",
    "build": "run-p type-check \"build-only {@}\" --",
    "preview": "vite preview",
    "build-only": "vite build",
    "type-check": "vue-tsc --build",
    "lint": "eslint . --fix",
    "format": "prettier --write src/"
  },
  "dependencies": {
    "pinia": "^3.0.3",
    "vue": "^3.5.18",
    "vue-router": "^4.5.1"
  },
  "devDependencies": {
    "@tsconfig/node22": "^22.0.2",
    "@types/node": "^22.16.5",
    "@vitejs/plugin-vue": "^6.0.1",
    "@vue/eslint-config-prettier": "^10.2.0",
    "@vue/eslint-config-typescript": "^14.6.0",
    "@vue/tsconfig": "^0.7.0",
    "eslint": "^9.32.0",
    "eslint-plugin-vue": "~10.3.0",
    "jiti": "^2.5.1",
    "npm-run-all2": "^8.0.4",
    "prettier": "3.6.2",
    "typescript": "~5.8.3",
    "vite": "^7.0.6",
    "vite-plugin-vue-devtools": "^8.0.0",
    "vue-tsc": "^3.0.4"
  }
}

Do you have a reproduction repo? I can't reproduce the issue on my machine.

Do you have a reproduction repo? I can't reproduce the issue on my machine.

You can find it here

Still can't reproduce. Here's the screencast, you can see there's no errors: asciicast

I tried cloning my own repo and building from there, but the error persists.

Image