Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable eslint correct?

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

like image 649
moses toh Avatar asked Nov 30 '22 13:11

moses toh


1 Answers

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/ 
like image 143
chans Avatar answered Dec 04 '22 07:12

chans