I want to have my serverside files in Node.js to have the exact same ESLint rules as my Vue.js frontend. The .eslintrc.js
file in my Vue project looks like this:
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint"
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
}
};
And my Node.js has an .eslintrc.js
that looks like this:
module.exports = {
root: true,
env: {
"es6": true,
"node": true
},
extends: [
"plugin:prettier/recommended"
],
globals: {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
parserOptions: {
"ecmaVersion": 2018,
"sourceType": "module"
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
}
}
Without importing all the Vue-specific linting rules (only want the vanilla javascript-related rules), how can I get the same ESLint rules on my Node.js without manually having to look up every frontend rule and copying it to the backend?