eslint配置
- "off" or 0 - 關(guān)閉規(guī)則
- "warn" or 1 - 將規(guī)則視為一個警告
- "error" or 2 - 將規(guī)則視為一個錯誤
如果是一般的項目想要寫點小東西,就不用配置的太麻煩
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": false
}
},
"extends": "eslint:recommended",
"rules": {
"semi": 2,
"no-console": 0
},
"env": {
"browser": true,
"node": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": false,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"jsx": true
}
}