8

I had follow the reference : https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories, but it does not work

I want to disable it, because I have many warning when run npm run serve about extra semicolon, spaces etc

My project using vuetify

enter image description here

I make .eslintignore and add script like this :

../src/*.js

I try to run npm run serve, but the warning is still exist

I try to add :

"eslintIgnore": ["store.js", "Home.vue"] in the package.json, but it also does not work

Whereas I had follow the docs

How can I solve this problem?

Update :

I try change like this :

src/**/*.js
src/**/*.vue

It does not work

moses toh
  • 12,344
  • 71
  • 243
  • 443
  • Why bother with ESLint at all if you want to ignore your entire `src` directory? In any case, try `src/**/*.js` and `src/**/*.vue` in your `.eslintignore` file – Phil Oct 30 '19 at 22:24
  • Possible duplicate of [How to disable ESLint in vue-cli?](https://stackoverflow.com/questions/38757069/how-to-disable-eslint-in-vue-cli) – Phil Oct 30 '19 at 22:27
  • @Phil Becuase there are many warning when run `npm run serve`. So I want to disable it. Your way is not work – moses toh Oct 30 '19 at 23:21
  • @Phil Before make this question, I had search reference(including the link above), But it does not works. that's why I made this question – moses toh Oct 30 '19 at 23:23
  • Either write your code to adhere to the ESLint rules or disable / remove ESLint entirely. Your question still shows `../src/*.js` which will not work. If you've tried something else, please [edit your question](https://stackoverflow.com/posts/58634424/edit) – Phil Oct 30 '19 at 23:25
  • The linked duplicate also shows several methods for disabling and removing ESLint. Have you tried all of those? – Phil Oct 30 '19 at 23:26
  • @Phil I had update my question. I had tried all of those. but it does not work – moses toh Oct 31 '19 at 01:00
  • What is `src/**/*.` meant to match? It won't match any `.vue` files which is why my first comment above has `src/**/*.vue` – Phil Oct 31 '19 at 01:03
  • @Phil I'm sorry. I had update it – moses toh Oct 31 '19 at 02:31
  • So you've updated `.eslintignore` and restarted your server, yes? What warnings **exactly** are you seeing? – Phil Oct 31 '19 at 03:29

1 Answers1

26

Eslint lint is a javascript opensource for linting utility. When you install a project using Vue cli, it automatically adds eslint-plugin to your project. It will have a es6 syntaxes guidelines, You can also create or disable the eslint rules.

If you want to disable eslint for a single line

just append this to a line of code

javascript code // eslint-disable-line

If you want to disable eslint for a complete file

/* eslint-disable */

code
/* eslint-disable */

If you want to remove eslint completely from a project which is created by vue cli 2

Set useEslint: false, in config/index.js

If you are using vue cli 3

In .eslintrc.js just set

root: false

Else, if you want to remove eslint completely from project

npm remove @vue/cli-plugin-eslint

If you have .eslintignore, you can add these lines there

/build/
/config/
/dist/
/*.js
/test/unit/coverage/

/000-xyz/ 
chans
  • 5,104
  • 16
  • 43