eslint verify vue file error unexpected token = Solution

 

 Solution: .eslintrc change the configuration file

 

{
	"extends": [
        'standard'
    ],
    "parserOptions":
    {
        "parser": "babel-eslint"
    },
    "parser": "vue-eslint-parser",
    "rules":
    {
        "no-tabs": "off",
        'no-mixed-spaces-and-tabs': 0,
    },
    "globals":
    {
        "document": true,
        "localStorage": true,
        "window": true
    }
}

  extends Property values ​​may be prefixed with the name of the package eslint-config- ,是一个 npm 包,它输出一个配置对象。要确保这个包安装在 ESLint 能请求到的目录下

"parserOptions": 
    { 
        "Parser": "Babel-eslint" 
    }, 
    "Parser": "vue-eslint-Parser", 
parse file vue
"the rules": 
    { 
        "NO-tabs": "OFF", 
        'NO-Mixed-Spaces-and-tabs': 0, 
    }, 
    "Globals": 
    { 
        "Document": to true, 
        "localStorage": to true, 
        "window ": to true 
    } 
is an evasion of tabs and spaces mix and define some variables need not be declared globally


Guess you like

Origin www.cnblogs.com/zaoa/p/11496252.html