How to disable ESLint in vue-cli?
151,082
Solution 1
Vue's starter projects are themselves built with a templating language.
Looking at the templates (the {{#lint}}
bits) it appears you can remove the entire preLoaders
block.
Solution 2
There are some out-of-date answers here.
Because vue-cli 3 is using a zero configuration approach, the way to disable it is to just uninstall the module:
npm remove @vue/cli-plugin-eslint
Solution 3
As of 2019, March
:
In the vue.config.js
:
module.exports = {
...
lintOnSave: false
...
}
Solution 4
in package.json
change the build step:
...
"scripts": {
"build": "vue-cli-service build --skip-plugins @vue/cli-plugin-eslint",
...
},
Solution 5
As of the current version (^3.0?) you can just set:
useEslint: false,
in config/index.js
Related videos on Youtube
Author by
Mahmud Adam
Updated on July 08, 2022Comments
-
Mahmud Adam almost 2 years
How do I go about disabling
ESlint
in project generated withvue-cli
?preLoaders: [ { test: /\.vue$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ }, { test: /\.js$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ } ]
If I remove the
loader: 'eslint'
line it won't compile, same with setting it to an empty string. I know I can opt out ofESLint
during the initialization phase, but how can I disable it after my project has been created?-
Himmet Avsar over 7 yearsWhich template are you using? Simple webpack?
-
Mahmud Adam over 7 yearsfull-featured Webpack
-
ceejayoz over 7 yearsLook at the
{{#lint}}
blocks in github.com/vuejs-templates/webpack/blob/… - can probably drop the entirepreLoaders
block? -
ceejayoz over 7 years@HectorLorenzo Moved it.
-
-
Bill Criswell over 7 yearsAlso, a cheap fix in case OP wants to easily enable and disable it is to add paths to the .eslintignore file.
-
Asqan about 7 years
src/*.js
didn't help to disable eslint for src file ... may be needed to take some extra steps? @BillCriswell -
Karl Pokus about 7 yearsYup. Blocking out this part works.
-
antoine almost 7 years@Asqan you might want to use
src/**/*.js
andsrc/**/*.vue
to ignore files recursively -
Mathews Sunny over 5 yearsAdd some description
-
sznowicki over 4 yearsOf course it's not working since
root
only tells ESLint that all the rules from parent folder should be dismissed. -
Anthony Kal over 4 yearsyou will need to do
npm run dev
again after doing changes to config -
db2 over 4 yearsSince the original question is 3 years old, this should definitely be marked as the correct answer.
-
sudoqux over 4 yearsThis works well if you want your IDE to handle linting based on .eslintrc.js, but have linting disabled when using the dev or watch npm-scripts.
-
Robin Nelson over 4 yearsI'm assuming this is how to disable before using the "vue create..." command? How do we disable eslint after creating a project?
-
Marius almost 4 yearsnpm remove is better. cli.vuejs.org/config/#pages says This value is respected only when @vue/cli-plugin-eslint is installed.
-
Rocky Kev over 3 yearsThis works! Answers prior to 2020 want you to add configs to files that no longer are part of the vue-cli template.
-
Sam over 3 yearsThis works great, just note that if you pass in other arguments, you'll need to do this first. Example: vue-cli-service --skip-plugins @vue/cli-plugin-eslint electron:build
-
Simon over 3 yearsno, that stops eslint running in webstorm — I don't get red squiggles.
-
AmirRezaM75 over 3 yearsyou can comment parser property in parserOptions
-
TetraDev over 3 yearsThis is only correct if you want to fully remove linting. If you just want to removing linting "ON SAVE" then use the solution provided by Aakass hand Radbyx.
-
Amir Asyraf about 3 years
setEslint
oruseEslint
? -
W. Murphy almost 3 yearsDespite the name, this setting really does disable lintOnBuild. Unlike other answer of uninstalling the cli plugin, this answer lets you still use the
vue-cli-service lint
command when you want it. -
Ashwani Garg over 2 yearsSolution works and prevents from unnecessary stress
-
itinance over 2 yearsThanks a lot! I am back to work and can finally focus on programming instead of removing helpful spaces and empty lines :)
-
light24bulbs over 2 yearsThis didn't work for me, and this option is no longer documented in the vue cli docs. What did work for me was simply deleting the
@vue/cli-plugin-eslint
module from my project -
trusktr over 2 yearsI removed
@vue/cli-plugin-eslint
and now the commandvue-cli-service serve
saysError: Cannot find module '@vue/cli-plugin-eslint'
. What else is needed?