At some point in one of my Vue projects Eslint started breaking builds due to any error (such as "Strings must use singlequote", or "Variable declared but never used"). Also the formatting errors are not corrected automatically (although they should?). I don't know when exatly this happened and what caused it. Could be after some npm install.
I have found multiple suggestions to solve the problem by adding emitWarning: true to eslint config, but it does not work form me unfortunatelly.
It seems to me that sometimes the first attempt to build is successfull and errors are "detected" and thrown only after I change something in the code, save and the server restars. Also eslint seems to care only about files that are actually open in VS Code at the moment, if I close a file and restart, eslint no longer cares that the formatting is incorrect there.
Here's my .eslintrc.js contents:
module.exports = {
root: true,
env: {
node: true,
"es6": true
},
extends: [
"plugin:vue/essential",
"@vue/standard"
],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"indent": ["error", 4],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "never"],
"quotes": ["error", "single"]
},
parserOptions: {
parser: "babel-eslint",
sourceType: "module",
ecmaVersion: 6,
emitWarning: true, // tried with and without this
emitError: false, // tried with and without this
failOnError: false, // tried with and without this
failOnWarning: false // tried with and without this
}
};
My other Vue project works fine. I'm not able to pinpoint any meaningful differences in setup.
How to stop eslint from breaking builds? What else can be wrong here? I'll be greatful for any help!