Gathering detailed insights and metrics for @vue/eslint-config-typescript
Gathering detailed insights and metrics for @vue/eslint-config-typescript
Gathering detailed insights and metrics for @vue/eslint-config-typescript
Gathering detailed insights and metrics for @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
ESLint configuration for Vue 3 + TypeScript projects
npm install @vue/eslint-config-typescript
Typescript
Module System
Min. Node Version
Node Version
NPM Version
91
Supply Chain
93.4
Quality
94.2
Maintenance
100
Vulnerability
97.9
License
TypeScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
124,235,723
Last Day
196,365
Last Week
1,028,072
Last Month
4,317,785
Last Year
44,922,493
MIT License
144 Stars
242 Commits
34 Forks
5 Watchers
8 Branches
92 Contributors
Updated on Feb 11, 2025
Minified
Minified + Gzipped
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
Cumulative downloads
Total Downloads
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
3
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.
1npm add --dev @vue/eslint-config-typescript
Please also make sure that you have typescript
and eslint
installed.
Because of the complexity of the configurations, this package exports several utilities:
defineConfigWithVueTs
, a utility function whose type signature is the same as the config
function from typescript-eslint
, but will modify the given ESLint config to work with Vue.js + TypeScript.vueTsConfigs
, contains all the shared configurations from typescript-eslint
(in camelCase, e.g. vueTsConfigs.recommendedTypeChecked
), and applies to .vue
files in addition to TypeScript files.configureVueProject({ scriptLangs, rootDir })
. More info below.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">
).
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)
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)
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.
typescript-eslint
.typescript-eslint
.@vue/eslint-config-standard-with-typescript
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
Reason
no binaries found in the repo
Reason
packaging workflow detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
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
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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 More