Gathering detailed insights and metrics for @vue/eslint-config-airbnb-with-typescript
Gathering detailed insights and metrics for @vue/eslint-config-airbnb-with-typescript
Gathering detailed insights and metrics for @vue/eslint-config-airbnb-with-typescript
Gathering detailed insights and metrics for @vue/eslint-config-airbnb-with-typescript
ESLint Shareable Configs for Airbnb JavaScript Style Guide in Vue.js Projects
npm install @vue/eslint-config-airbnb-with-typescript
Typescript
Module System
Node Version
NPM Version
62.1
Supply Chain
86.8
Quality
74.9
Maintenance
100
Vulnerability
94.8
License
JavaScript (100%)
Total Downloads
1,812,351
Last Day
429
Last Week
30,451
Last Month
146,483
Last Year
1,006,233
MIT License
73 Stars
153 Commits
19 Forks
5 Watchers
3 Branches
76 Contributors
Updated on Jun 05, 2025
Minified
Minified + Gzipped
Latest Version
8.0.0
Package Id
@vue/eslint-config-airbnb-with-typescript@8.0.0
Unpacked Size
22.37 kB
Size
7.40 kB
File Count
9
NPM Version
10.2.0
Node Version
18.18.2
Published on
Dec 28, 2023
Cumulative downloads
Total Downloads
Last Day
-32.7%
429
Compared to previous day
Last Week
-55.5%
30,451
Compared to previous week
Last Month
53.7%
146,483
Compared to previous month
Last Year
42.9%
1,006,233
Compared to previous year
11
3
3
@vue/eslint-config-airbnb-with-typescript
eslint-config-airbnb-with-typescript for Vue
This config is specifically designed to be used by @vue/cli
& 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 @vue/cli
/create-vue
setups, such as eslint-plugin-vue
being
extended in the same resulting config.
In order to work around a known limitation in ESLint, we recommend you to use this package alongside @rushstack/eslint-patch
, so that you don't have to install too many dependencies:
1npm add --dev @vue/eslint-config-airbnb-with-typescript @rushstack/eslint-patch
An example .eslintrc.cjs
:
1require("@rushstack/eslint-patch/modern-module-resolution") 2 3module.exports = { 4 root: true, 5 extends: [ 6 'plugin:vue/vue3-essential', 7 '@vue/eslint-config-airbnb-with-typescript' 8 ] 9}
This ruleset automatically reads the TypeScript path mappings from **/tsconfig.json
and **/tsconfig.*.json
files in the project. You don't need any additional configuration to set up aliases.
If your TSConfig files are in a different location, please refer to the Non-Conventional TSConfig Locations section.
.vue
Files (NOT Recommended)By default this ruleset only allows using <script lang="ts">
(and <script setup lang="ts">
) in .vue
files.
If you need to use plain <script>
in .vue
files:
compilerOptions.allowJs
to true
in your TSConfig.allow-js-in-vue
ruleset to your .eslintrc.cjs
:1require("@rushstack/eslint-patch/modern-module-resolution") 2 3module.exports = { 4 root: true, 5 extends: [ 6 'plugin:vue/vue3-essential', 7 '@vue/eslint-config-airbnb-with-typescript' 8 '@vue/eslint-config-airbnb-with-typescript/allow-js-in-vue' 9 ] 10}
If you encounter any no-undef
errors when using global variables/functions, please configure the env
option for ESLint.
.vue
Files (Strongly NOT Recommended)There's a limitation in @typescript-eslint/parser
that it cannot parse JSX syntaxes in .vue
files when parserOptions.project
is set.
So, by default, we disallow <script lang="tsx">
and <script lang="jsx">
in .vue
files.
You can use JSX syntax in standalone .tsx
and .jsx
files instead.
If you do need to use <script lang="tsx">
or <script lang="jsx">
in your .vue
files, you can apply the allow-tsx-in-vue
/allow-jsx-in-vue
config to all .vue
files to disable those rules that require type informations (e.g., no-floating-promises
):
1require("@rushstack/eslint-patch/modern-module-resolution") 2 3module.exports = { 4 root: true, 5 extends: [ 6 'plugin:vue/vue3-essential', 7 '@vue/eslint-config-airbnb-with-typescript', 8 '@vue/eslint-config-airbnb-with-typescript/allow-tsx-in-vue' 9 ] 10}
Turning on allow-jsx-in-vue
would allow both <script lang="tsx">
and <script lang="jsx">
, and requiring a carefully configured env
field as aforementioned in the JS support section:
1require("@rushstack/eslint-patch/modern-module-resolution") 2 3module.exports = { 4 root: true, 5 extends: [ 6 'plugin:vue/vue3-essential', 7 '@vue/eslint-config-airbnb-with-typescript', 8 '@vue/eslint-config-airbnb-with-typescript/allow-jsx-in-vue' 9 ] 10}
Note that doing so would catch fewer errors.
By default, this ruleset searches for TSConfig files matching **/tsconfig.json
and **/tsconfig.*.json
from the current working directory.
This should cover most use cases.
However, if your TSConfig file is located somewhere else (e.g., in an ancestor directory), or doesn't follow the conventional naming (e.g., named as my-custom-tsconfig.json
), you need to specify the location in your .eslintrc.cjs
manually:
1require("@rushstack/eslint-patch/modern-module-resolution") 2const createAliasSetting = require('@vue/eslint-config-airbnb-with-typescript/createAliasSetting') 3 4module.exports = { 5 root: true, 6 extends: [ 7 'plugin:vue/vue3-essential', 8 '@vue/eslint-config-airbnb-with-typescript' 9 ], 10 parserOptions: { 11 project: ['/path/to/my-custom-tsconfig.json'] 12 }, 13 settings: { 14 ...createAliasSetting(['/path/to/my-custom-tsconfig.json']) 15 } 16}
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
If you are using this config in an existing project, you may encounter this error:
1Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. 2The file does not match your project config: foo.js. 3The file must be included in at least one of the projects provided
It is likely because your existing tsconfig.json
does not include all of the files you would like to lint.
(This doesn't usually happen in projects created by create-vue
because it creates projects with solution-style tsconfig.json
files that cover every file in the project.)
A workaround is to create a separate tsconfig.eslint.json
as follows:
1{ 2 // Extend your base config so you don't have to redefine your compilerOptions 3 "extends": "./tsconfig.json", 4 "include": [ 5 // Include all files in the project 6 "./**/*", 7 // By default the `include` glob pattern doesn't match `.vue` files, so we add it explicitly 8 "./**/*.vue" 9 ], 10 "compilerOptions": { 11 // Include `.js` & `.jsx` extensions 12 "allowJs": true 13 } 14}
IE 11 reached End-of-Life on June 15, 2022, so this configuration doesn't include any rules that are specific to IE 11.
If your project still has to support IE 11, we recommend you to add the following 2 rules to your config:
1module.exports = { 2 // ... 3 4 rules: { 5 // Enforce `rel="noopener noreferrer"` on external links in `<template>` 6 // https://eslint.vuejs.org/rules/no-template-target-blank.html 7 'vue/no-template-target-blank': 'error', 8 // Enforce `rel="noopener noreferrer"` on external links in JSX 9 // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md 10 'react/jsx-no-target-blank': 'error', 11 } 12}
It seems possible to lift the TSX/JSX restriction in .vue
files without disabling the type-aware linting rules.
@typescript-eslint/parser
allows passing program
instance to override any programs that would have been computed from parserOptions.project
.
If we provide a program
created by Volar, maybe it can have better support for .vue
files?
I haven't yet got the time to try it out.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/29 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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