First I created vue project.
npm init vue@latest
Then I added rules to the .eslintrc.cjs.
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier'
],
parserOptions: {
ecmaVersion: 'latest'
},
rules: {
indent: ["error", 4],
"vue/html-indent": ["error", 4],
},
}
Finally I ran the program.
cd test
npm install
npm run lint
But I got the error.
✖ 209 problems (142 errors, 67 warnings)
142 errors and 67 warnings potentially fixable with the `--fix` option.
The setting of "scripts" in the package.json is as follows.
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
How can I fix the errors automatically?