Eslint 无法覆盖 parseOptions
ESlint cannot override parseOptions
我无法进行配置来覆盖 eslint.js
的主要配置
.eslintrc
module.exports = {
"root": true,
"env": {
"node": true,
"browser": true,
},
"globals": {},
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
},
},
"extends": ["myplugin"],
"rules": {
"prettier/prettier": ["error"],
},
}
eslint-config-myplugin
module.exports = {
"parserOptions": {
"ecmaVersion": 6,
}
}
我收到这个错误:
0:0 error Parsing error: sourceType 'module' is not supported when ecmaVersion < 2015. 考虑将 { ecmaVersion: 2015 }
添加到解析器选项
✖ 1 个问题(1 个错误,0 个警告)
这就是它设计的工作方式,将解析器选项设置为您需要的 .eslintrc
我无法进行配置来覆盖 eslint.js
的主要配置.eslintrc
module.exports = {
"root": true,
"env": {
"node": true,
"browser": true,
},
"globals": {},
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
},
},
"extends": ["myplugin"],
"rules": {
"prettier/prettier": ["error"],
},
}
eslint-config-myplugin
module.exports = {
"parserOptions": {
"ecmaVersion": 6,
}
}
我收到这个错误:
0:0 error Parsing error: sourceType 'module' is not supported when ecmaVersion < 2015. 考虑将 { ecmaVersion: 2015 }
添加到解析器选项
✖ 1 个问题(1 个错误,0 个警告)
这就是它设计的工作方式,将解析器选项设置为您需要的 .eslintrc