2.3.3 • Published 1 year ago
eslint-preset-vue v2.3.3
Shareable ESLint preset for vue.
Usage
- Install package:
pnpm add --save-dev eslint eslint-preset-basic eslint-preset-vue
- Create ESLint configuration file
eslint.config.js
:
import { defineFlatConfig, presetBasic } from 'eslint-preset-basic'
import { presetVue } from 'eslint-preset-vue'
export default defineFlatConfig([
presetBasic({ enableTs: true }),
presetVue({ enableTs: true }),
// {
// rules: {...}
// }
])
If your project does not specify
"type":"module"
in its package.json file, theneslint.config.js
must be in CommonJS format, such as:
module.exports = (async () => {
const { defineFlatConfig, presetBasic } = await import('eslint-preset-basic')
const { presetVue } = await import('eslint-preset-vue')
return defineFlatConfig([
presetBasic({ enableTs: true }),
presetVue({ enableTs: true }),
// {
// rules: {...}
// }
])
})()
- Add script for package.json:
{
"scripts": {
"lint": "eslint .",
}
}
VS Code support
Install VS Code ESLint extension
Add the following settings to your project setting .vscode/settings.json
:
{
// Auto fix
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
},
// Enable the flat config support
"eslint.experimental.useFlatConfig": true,
// Enable eslint for supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
"vue"
]
}
Please support this project by simply putting a star.
And, enjoy :)
2.3.0
1 year ago
2.3.2
1 year ago
2.3.1
1 year ago
2.3.3
1 year ago
2.2.2
1 year ago
2.2.1
1 year ago
2.2.0
1 year ago
2.1.1
1 year ago
2.1.0
1 year ago
0.0.1
1 year ago
0.0.0
1 year ago
2.0.3
1 year ago
2.0.2
1 year ago
2.0.1
1 year ago
2.0.0
1 year ago
1.3.1
1 year ago
1.3.0
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago