eslint-config-firstvet
v7.0.0
Published
FirstVet lint rules
Downloads
1,716
Keywords
Readme
FirstVet ESLint Rules
From your repository, run
npx install-peerdeps -D eslint-config-firstvet
. Requires npm 5+.Create
.eslintrc.json
in your root and paste one of the following:
JS
{
"extends": ["firstvet"]
}
JS + Vue
{
"extends": ["firstvet/vue"]
}
Setup autoformatting on save for VS Code users:
Install VS Code plugin ESLint.
Open your
settings.json
in VS Code and add/edit the following:
// Turn editor formatting since we will do this via ESLint.
"[javascript]": {
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
},
"[json]": {
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
},
"[vue]": {
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
},
"[typescript]": {
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
},
// Tell the ESLint plugin to run on save.
"eslint.validate": ["javascript", "json", "vue", "typescript"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// Turn off prettier formatting (if previously installed).
"prettier.disableLanguages": ["javascript", "json", "vue", "typescript"],
"path-intellisense.mappings": {
"@": "${workspaceRoot}/src"
}
Note
There is an issue with VSCode and autoformatting on subdirectories. If the linting rules are used in a subdirectory you will need to open that directory as the "project root" in VSCode for it to work. See thread on StackOverflow.