[Vuejs]-How to match Node.js server's ESLint rules to my Vue.js frontend's ESLint rules?

0👍

You can simply import it from the front end .eslintrc.js

your nodejs .eslintrc.js should be:

const frontEndRc = require("path_to_your_frontend_eslintrc");

module.exports = {
    root: true,
    env: {
        "es6": true,
        "node": true
    },
    extends: [
        "plugin:prettier/recommended"
    ],
    globals: {
        "Atomics": "readonly",
        "SharedArrayBuffer": "readonly"
    },
    parserOptions: {
        "ecmaVersion": 2018,
        "sourceType": "module"
    },
    rules: {
        ...frontEndRc.rules
    }
}

Leave a comment