# Vue Eslint Config Typescript > export function defineConfigWithVueTs( --- # Source: https://github.com/vuejs/eslint-config-typescript # API Reference ## defineConfigWithVueTs **Type**: Function **Signature**: ```typescript export function defineConfigWithVueTs( ...configs: FlatConfig[] ): FlatConfig[] ``` **Description**: Transforms ESLint flat configurations to work with Vue 3 + TypeScript. **Parameters**: - Accepts any number of ESLint flat config objects **Returns**: Modified flat config array optimized for Vue 3 + TypeScript **Example**: ```javascript import pluginVue from 'eslint-plugin-vue' import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' export default defineConfigWithVueTs( pluginVue.configs['flat/essential'], vueTsConfigs.recommended, ) ``` ## vueTsConfigs **Type**: Object with config properties **Available Configs**: ### vueTsConfigs.base - Type-aware: No - Use case: Starting point for custom rule configuration ### vueTsConfigs.recommended - Type-aware: No - Use case: Standard recommended setup without type checking ### vueTsConfigs.recommendedTypeChecked - Type-aware: Yes (with type checking enabled) - Use case: Recommended setup with advanced type-aware rules - Performance impact: Slower (requires type-checking) ### vueTsConfigs.strict - Type-aware: No - Use case: Strict rules without type-aware linting - Performance: Faster than type-checked versions ### vueTsConfigs.strictTypeChecked - Type-aware: Yes (with type checking enabled) - Use case: Maximum strictness with type-aware rules - Performance impact: Slowest (requires type-checking) **Example**: ```javascript export default defineConfigWithVueTs( pluginVue.configs['flat/essential'], vueTsConfigs.recommendedTypeChecked, ) ``` ## configureVueProject(options) **Type**: Function **Signature**: ```typescript export function configureVueProject(options?: { tsSyntaxInTemplates?: boolean scriptLangs?: string[] allowComponentTypeUnsafety?: boolean rootDir?: string }): void ``` **Description**: Configures Vue project-specific ESLint settings. **Options**: ### tsSyntaxInTemplates - **Type**: boolean - **Default**: true - **Description**: Parse TypeScript syntax in Vue template expressions - **Performance**: Set to false for ~20-30% faster linting if templates don't use TypeScript ### scriptLangs - **Type**: string[] - **Default**: ['ts'] - **Allowed values**: 'ts', 'js', 'tsx', 'jsx' - **Note**: Only 'ts' is recommended; other options may conflict with type-aware rules ### allowComponentTypeUnsafety - **Type**: boolean - **Default**: true - **Description**: Relax `no-unsafe-*` rules for Vue component type operations - **Use case**: Keep true for Vue SFC projects; set false for TSX-only projects with strict typing ### rootDir - **Type**: string - **Default**: process.cwd() - **Description**: Root directory for resolving .vue files - **Important**: Set this for monorepo setups to properly resolve all .vue files **Example**: ```javascript import { configureVueProject } from '@vue/eslint-config-typescript' configureVueProject({ tsSyntaxInTemplates: true, scriptLangs: ['ts'], allowComponentTypeUnsafety: true, rootDir: import.meta.dirname, }) ``` ## Configuration Properties ESLint flat config objects have: - `files` - Glob patterns for files to apply rules - `rules` - Rule name to severity mapping - `languageOptions` - Parser, globals, sourceType settings - `plugins` - ESLint plugins When using these utilities, they automatically configure: - Vue file parsing - TypeScript parser setup - TypeScript ESLint plugin - Vue ESLint plugin integration --- # Examples ## allow-js # allow-js This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## api-before-14.3 # api-before-14.3 This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh npm run test:unit ``` ### Run End-to-End Tests with [Cypress](https://www.cypress.io/) ```sh npm run test:e2e:dev ``` This runs the end-to-end tests against the Vite development server. It is much faster than the production build. But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): ```sh npm run build npm run test:e2e ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## custom-type-checked-rules-on-and-off # custom-type-checked-rules-on-and-off This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## disable-ts-in-templates # disable-ts-in-templates This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## disable-type-checked-for-yml # disable-type-checked-for-yml This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh npm run test:unit ``` ### Run End-to-End Tests with [Cypress](https://www.cypress.io/) ```sh npm run test:e2e:dev ``` This runs the end-to-end tests against the Vite development server. It is much faster than the production build. But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): ```sh npm run build npm run test:e2e ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## minimal # minimal This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## quasar-project # Quasar App (quasar-project) A Quasar Project ## Install the dependencies ```bash yarn # or npm install ``` ### Start the app in development mode (hot-code reloading, error reporting, etc.) ```bash quasar dev ``` ### Lint the files ```bash yarn lint # or npm run lint ``` ### Format the files ```bash yarn format # or npm run format ``` ### Build the app for production ```bash quasar build ``` ### Customize the configuration See [Configuring quasar.config.js](https://v2.quasar.dev/quasar-cli-vite/quasar-config-js). ## type-checked # type-checked This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh npm run test:unit ``` ### Run End-to-End Tests with [Cypress](https://www.cypress.io/) ```sh npm run test:e2e:dev ``` This runs the end-to-end tests against the Vite development server. It is much faster than the production build. But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): ```sh npm run build npm run test:e2e ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-cypress # with-cypress This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run Headed Component Tests with [Cypress Component Testing](https://on.cypress.io/component) ```sh npm run test:unit:dev # or `npm run test:unit` for headless testing ``` ### Run End-to-End Tests with [Cypress](https://www.cypress.io/) ```sh npm run test:e2e:dev ``` This runs the end-to-end tests against the Vite development server. It is much faster than the production build. But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): ```sh npm run build npm run test:e2e ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-jsx # with-jsx This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-jsx-in-vue # with-jsx-in-vue This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-nightwatch # with-nightwatch This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run End-to-End Tests with [Nightwatch](https://nightwatchjs.org/) ```sh # When using CI, the project must be built first. npm run build # Runs the end-to-end tests npm run test:e2e # Runs the tests only on Chrome npm run test:e2e -- --env chrome # Runs the tests of a specific file npm run test:e2e -- tests/e2e/example.ts # Runs the tests in debug mode npm run test:e2e -- --debug ``` ### Run Headed Component Tests with [Nightwatch Component Testing](https://nightwatchjs.org/guide/component-testing/introduction.html) ```sh npm run test:unit npm run test:unit -- --headless # for headless testing ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-playwright # with-playwright This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run End-to-End Tests with [Playwright](https://playwright.dev) ```sh # Install browsers for the first run npx playwright install # When testing on CI, must build the project first npm run build # Runs the end-to-end tests npm run test:e2e # Runs the tests only on Chromium npm run test:e2e -- --project=chromium # Runs the tests of a specific file npm run test:e2e -- tests/example.spec.ts # Runs the tests in debug mode npm run test:e2e -- --debug ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-prettier # with-prettier This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-tsx # with-tsx This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-tsx-in-vue # with-tsx-in-vue This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## with-vitest # with-vitest This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh npm run test:unit ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ```