An ESLint shareable config for TypeScript that is based on eslint-config-standard and has TypeScript specific rules from @typescript-eslint/eslint-plugin along with Vue support.
npm@<7
does not automatically install peerDependencies
,
so if that's what you're using, install them manually.
Here is an example, but use it only for reference,
because your decisions regarding version ranges and range specifiers may vary.
npm install --save-dev typescript@* eslint@^8.0.1 eslint-config-vue-standard-typescript@latest
To remove the need for a large number of packages, yet allowing us to give you control, we use the rushstack eslint-patch.
Here is an example .eslintrc.js
/ .eslintrc.cjs
:
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
extends: 'vue-standard-typescript',
parserOptions: {
project: './tsconfig.json'
}
}
Note: Please read some important instructions regarding the project
option here.
There are some more parserOptions
you may care about.
Example command line usage:
$ npx eslint .