ESLint configuration for Vue 3 + TypeScript projects
Installations
npm install @vue/eslint-config-typescript
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
^18.18.0 || ^20.9.0 || >=21.1.0
Node Version
22.13.1
NPM Version
10.9.2
Score
91
Supply Chain
93.4
Quality
94.2
Maintenance
100
Vulnerability
97.9
License
Releases
Contributors
Languages
TypeScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
vuejs
Download Statistics
Total Downloads
124,235,723
Last Day
196,365
Last Week
1,028,072
Last Month
4,317,785
Last Year
44,922,493
GitHub Statistics
MIT License
144 Stars
242 Commits
34 Forks
5 Watchers
8 Branches
92 Contributors
Updated on Feb 11, 2025
Bundle Size
478.28 kB
Minified
139.78 kB
Minified + Gzipped
Package Meta Information
Latest Version
14.4.0
Package Id
@vue/eslint-config-typescript@14.4.0
Unpacked Size
43.01 kB
Size
8.71 kB
File Count
7
NPM Version
10.9.2
Node Version
22.13.1
Published on
Feb 09, 2025
Total Downloads
Cumulative downloads
Total Downloads
124,235,723
Last Day
1.7%
196,365
Compared to previous day
Last Week
5.7%
1,028,072
Compared to previous week
Last Month
53.8%
4,317,785
Compared to previous month
Last Year
33.3%
44,922,493
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
3
@vue/eslint-config-typescript
ESLint configuration for Vue 3 + TypeScript projects.
See @typescript-eslint/eslint-plugin for available rules.
This config is specifically designed to be used by create-vue
setups
and is not meant for outside use (it can be used but some adaptations
on the user side might be needed - for details see the config file).
A part of its design is that this config may implicitly depend on
other parts of create-vue
setups, such as eslint-plugin-vue
being
extended in the same resulting config.
[!NOTE] The current version doesn't support the legacy
.eslintrc*
configuration format. For that you need to use version 13 or earlier. See the corresponding README for more usage instructions.
Installation
1npm add --dev @vue/eslint-config-typescript
Please also make sure that you have typescript
and eslint
installed.
Usage
Because of the complexity of the configurations, this package exports several utilities:
defineConfigWithVueTs
, a utility function whose type signature is the same as theconfig
function fromtypescript-eslint
, but will modify the given ESLint config to work with Vue.js + TypeScript.vueTsConfigs
, contains all the shared configurations fromtypescript-eslint
(in camelCase, e.g.vueTsConfigs.recommendedTypeChecked
), and applies to.vue
files in addition to TypeScript files.- a Vue-specific config factory:
configureVueProject({ scriptLangs, rootDir })
. More info below.
Minimal Setup
1// eslint.config.mjs 2import pluginVue from 'eslint-plugin-vue' 3import { 4 defineConfigWithVueTs, 5 vueTsConfigs, 6} from '@vue/eslint-config-typescript' 7 8export default defineConfigWithVueTs( 9 pluginVue.configs['flat/essential'], 10 vueTsConfigs.recommended, 11)
The above configuration enables the essential rules for Vue 3 and the recommended rules for TypeScript.
All the <script>
blocks in .vue
files MUST be written in TypeScript (should be either <script setup lang="ts">
or <script lang="ts">
).
Advanced Setup
1// eslint.config.mjs
2import pluginVue from 'eslint-plugin-vue'
3import {
4 defineConfigWithVueTs,
5 vueTsConfigs,
6 configureVueProject,
7} from '@vue/eslint-config-typescript'
8
9configureVueProject({
10 // Whether to parse TypeScript syntax in Vue templates.
11 // Defaults to `true`.
12 // Setting it to `false` could improve performance.
13 // But TypeScript syntax in Vue templates will then lead to syntax errors.
14 // Also, type-aware rules won't be applied to expressions in templates in that case.
15 tsSyntaxInTemplates: true,
16
17 // Optional: specify the script langs in `.vue` files
18 // Defaults to `['ts']`.
19 scriptLangs: [
20 'ts',
21
22 // [!DISCOURAGED]
23 // Include 'js' to allow plain `<script>` or `<script setup>` blocks.
24 // This might result-in false positive or negatives in some rules for `.vue` files.
25 // Note you also need to configure `allowJs: true` and `checkJs: true`
26 // in corresponding `tsconfig.json` files.
27 'js',
28
29 // [!STRONGLY DISCOURAGED]
30 // Include 'tsx' to allow `<script lang="tsx">` blocks.
31 // This would be in conflict with all type-aware rules.
32 'tsx',
33
34 // [!STRONGLY DISCOURAGED]
35 // Include 'jsx' to allow `<script lang="jsx">` blocks.
36 // This would be in conflict with all type-aware rules and may result in false positives.
37 'jsx',
38 ],
39
40 // <https://github.com/vuejs/eslint-plugin-vue/issues/1910#issuecomment-1819993961>
41 // Optional: the root directory to resolve the `.vue` files, defaults to `process.cwd()`.
42 // You may need to set this to the root directory of your project if you have a monorepo.
43 // This is useful when you allow any other languages than `ts` in `.vue` files.
44 // Our config helper would resolve and parse all the `.vue` files under `rootDir`,
45 // and only apply the loosened rules to the files that do need them.
46 rootDir: import.meta.dirname,
47})
48
49export default defineConfigWithVueTs(
50 pluginVue.configs["flat/essential"],
51
52 // We STRONGLY RECOMMEND you to start with `recommended` or `recommendedTypeChecked`.
53 // But if you are determined to configure all rules by yourself,
54 // you can start with `base`, and then turn on/off the rules you need.
55 vueTsConfigs.base,
56)
Linting with Type Information
Some typescript-eslint
rules utilizes type information to provide deeper insights into your code.
But type-checking is a much slower process than linting with only syntax information.
It is not always easy to set up the type-checking environment for ESLint without severe performance penalties.
So we don't recommend you to configure individual type-aware rules and the corresponding language options all by yourself.
Instead, you can start by extending from the recommendedTypeChecked
configuration and then turn on/off the rules you need.
1// eslint.config.mjs 2import pluginVue from 'eslint-plugin-vue' 3import { 4 defineConfigWithVueTs, 5 vueTsConfigs, 6} from '@vue/eslint-config-typescript' 7 8export default defineConfigWithVueTs( 9 pluginVue.configs['flat/essential'], 10 vueTsConfigs.recommendedTypeChecked 11)
Use As a Normal Shared ESLint Config (Not Recommended)
You can use this package as a normal ESLint config, without the defineConfigWithVueTs
helper. But in this case, overriding the rules for .vue
files would be more difficult and comes with many nuances. Please be cautious.
You can check the documentation for 14.1 and earlier versions for more information.
Further Reading
- All the extendable configurations from
typescript-eslint
. - All the available rules from
typescript-eslint
.
With Other Community Configs
- For JavaScript Standard Style, use
@vue/eslint-config-standard-with-typescript
- Airbnb JavaScript Style Guide support is still in progress.

No vulnerabilities found.
Reason
30 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no binaries found in the repo
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:9
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6
- Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq
Reason
branch protection is not maximal on development and all release branches
Details
- Info: 'allow deletion' disabled on branch 'main'
- Info: 'force pushes' disabled on branch 'main'
- Info: 'branch protection settings apply to administrators' is required to merge on branch 'main'
- Warn: could not determine whether codeowners review is allowed
- Warn: no status checks found to merge onto branch 'main'
- Warn: PRs are not required to make changes on branch 'main'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings
Reason
Found 3/11 approved changesets -- score normalized to 2
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/publish.yml:14
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/publish.yml:1
- Info: no jobLevel write permissions found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/vuejs/eslint-config-typescript/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/vuejs/eslint-config-typescript/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/vuejs/eslint-config-typescript/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/vuejs/eslint-config-typescript/publish.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/vuejs/eslint-config-typescript/publish.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/vuejs/eslint-config-typescript/publish.yml/main?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 24 are checked with a SAST tool
Score
5
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @vue/eslint-config-typescript
eslint-config-alloy
AlloyTeam ESLint 规则
@vue/eslint-config-airbnb-with-typescript
eslint-config-airbnb for Vue.js projects with TypeScript support
eslint-config-tencent
ESLint Config for Tencent
@vue/eslint-config-standard-with-typescript
eslint-config-standard-with-typescript for Vue.js projects