Skip to content
David Graham edited this page May 8, 2018 · 13 revisions

Configure

The .eslint.js file holds the configuration for the linter. Most projects I've seen prefer the Standard preset (a.k.a. the one without semi-colons) so I selected that for this project (from the Vue-cli).

Recommended Vue Rules

Vue also has some recommended rules that you can add via the eslint-plugin-vue (which I've added to the package.json for this project). You can open up the .eslint.js file and notice all the additions I've added there (on top of what Vue-cli created).

$ npm install --save-dev eslint-plugin-vue

Visual Studio Code

Make sure you have added the ESLint extension for VS Code. You also need to add Vue to the eslint.validate setting in your .vscode/settings.json file. See the Visual Studio Code page of this wiki for more info.

Ignore File

You can tell ESLint to ignore specific files and directories by using an .eslintignore file in your project's root directory. The ignore pattern works just like .gitignore does:

build/*.js
config/*.js
Clone this wiki locally