eslint-config-airbnb for Vue.js projects with TypeScript support
npm install @vue/eslint-config-airbnb-with-typescript@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:
``sh`
npm add --dev @vue/eslint-config-airbnb-with-typescript @rushstack/eslint-patch
An example .eslintrc.cjs:
`js
require("@rushstack/eslint-patch/modern-module-resolution")
module.exports = {
root: true,
extends: [
'plugin:vue/vue3-essential',
'@vue/eslint-config-airbnb-with-typescript'
]
}
`
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.
Files (NOT Recommended)By default this ruleset only allows using