eslint-config-firstvet

6.0.0 • Public • Published

FirstVet ESLint Rules

  1. From your repository, run npx install-peerdeps -D eslint-config-firstvet. Requires npm 5+.

  2. 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:

  1. Install VS Code plugin ESLint.

  2. 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.

Readme

Keywords

Package Sidebar

Install

npm i eslint-config-firstvet

Weekly Downloads

798

Version

6.0.0

License

ISC

Unpacked Size

5.24 kB

Total Files

6

Last publish

Collaborators

  • mikaelrosquist
  • inaschmitz
  • walentinwidgren