vue-tsc-eslint-hook
v1.8.27
Published
Use ESLint with vue-tsc to have better performance and accuracy.
Downloads
374
Readme
vue-tsc-eslint-hook
Use ESLint with vue-tsc to have better performance and accuracy.
Example: https://github.com/DrJume/vue-volar-eslint
Usage
package.json
{
"devDependencies": {
"eslint": "latest",
"vue-tsc": "latest",
"vue-tsc-eslint-hook": "latest"
}
}
tsconfig.json
{
"vueCompilerOptions": {
"hooks": [
"./vue-tsc-hook.js"
]
}
}
vue-tsc-hook.js
module.exports = (program) =>
require('vue-tsc-eslint-hook')(
program,
(program) => ({
...baseConfig,
parserOptions: {
...baseConfig.parserOptions,
programs: [program], // replace eslint typescript program
},
// ignore non-ts virtual files that was generated by volar
ignorePatterns: ['**/*.vue', '**/*.html', '**/*.pug', '**/*.css', '**/*.scss'],
overrides: [
...baseConfig.overrides ?? [],
{
// ignore format linting for virtual ts code
files: ['*.vue.ts', '*.vue.js', '*.vue.tsx', '*.vue.jsx'],
rules: {
'prettier/prettier': 'off',
},
},
],
})
)