Eslint-plugin-vue plug-in about the problem that script always indents in and out of vue files

vue-cli adds eslinit error after generating vue project.
version is as follows:

"babel-eslint": "^8.2.1",
 "eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",

the specific configuration is as follows:

// https://eslint.org/docs/user-guide/configuring

module.exports = {
    root: true,
    parserOptions: {
        parser: "babel-eslint"
    },
    env: {
        browser: true
    },
    extends: [
        // https://github.com/vuejs/eslint-plugin-vue-sharppriority-a-essential-error-prevention
        // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
        "plugin:vue/essential",
        // https://github.com/standard/standard/blob/master/docs/RULES-en.md
        "standard"
    ],
    // required to lint *.vue files
    plugins: [
        "vue"
    ],
    // add your custom rules here
    rules: {
        // allow paren-less arrow functions
        "arrow-parens": 0,
        // allow async-await
        "generator-star-spacing": "off",
        // allow debugger during development
        "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
        // 
        "comma-spacing": 0,
        //
        "space-before-function-paren": 0,
        // ,
        "quotes": 0,
        //
        "no-trailing-spaces": 0,

        "no-unused-vars": 0,
        // 
        "semi": [2, "always"],
        //100
        "no-multiple-empty-lines": [0, {"max": 100}],
        //tab
        "no-mixed-spaces-and-tabs": [0],
        "no-tabs": 0,
        "indent": ["error", "tab"],
        //"indent": 0,
        //
        "spaced-comment": 0,
        //
        "padded-blocks": 0,
        "no-useless-escape": 0
    },
    "overrides": [
        {
            "files": ["*.vue"],
            "rules": {
                "indent": "off",
                "vue/script-indent": ["error", 4, {"baseIndent": 4}]
            }
        }
    ]
}

the error message is as follows:

clipboard.png

clipboard.png

the solution has been found all over the issue on the official github, and even the overrides in the configuration is officially found. Now we can only turn off the ident
official github: https://github.com/vuejs/esli.

.
Mar.24,2021

official configuration items can be fixed
link: script-indent


updating vue-cli encountered this problem! I haven't found a suitable way so far. Just find two temporary workarounds:

  1. rollback uses the eslint-plugin-html plug-in instead of eslint-plugin-vue
  2. like you said, turn off 'indent':' off'

Hey, obsessive-compulsive disorder! Get used to indenting the first line of script tag content.

Menu