.eslintrc

{
    "env": {
        "browser": true,
        "commonjs": true,
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "sourceType": "module"
    },
    "rules": {
        "indent": [
            "error",
            "tab"
        ],
        "linebreak-style": 0,
        "quotes": [
            "error",
            "single"
        ],
        "semi": [
            "error",
            "always"
        ],
        "no-console": [
            "error",
            {
                "allow": ["warn", "error", "log"]
            }
        ]
    }
}

package.json

"scripts": {
    "lint": "node node_modules/eslint-watch/bin/esw *.js server config --color",
    "lint": "esw *.js server config --color",
    "lint:watch": "yarn lint -- --watch",
}

结果

Scroll to Top