My shareable ESLint configuration. Inspired by https://github.com/antfu/eslint-config
- Out of the box.
- Support
javascript
,typescript
,javascriptreact
,typescriptreact
,vue
andjson
,package.json
,tsconfig.json
files.
npm i -D @luooooob/eslint-config
{
"extends": "@luooooob"
}
{
"scripts": {
"lint": "eslint . --fix"
}
}
I recommend using eslint as the default formatter of your editor. For example, if you are using VS Code, create a .vscode/settings.json
:
{
"editor.formatOnSave": true,
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"json"
],
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"[json]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
}