我对基本的 eslint 配置有疑问。我已经开始从教程中学习 React。
我得到错误:
/NotesInReact/node_modules/eslint-config-airbnb-base/rules/style.js:
Configuration for rule "padded-blocks" is invalid:
Value [{"blocks":"never","classes":"never","switches":"never"},{"allowSingleLineBlocks":true}] should NOT have more than 1 items.
Referenced from: /NotesInReact/node_modules/eslint-config-airbnb-base/index.js
Referenced from: /NotesInReact/node_modules/eslint-config-airbnb/index.js
Referenced from: /NotesInReact/.eslintrc.js
我的eslint配置文件:
module.exports = {
extends: [
'airbnb',
'prettier',
'prettier/react',
],
env: {
jest: true,
},
globals: {
document: true,
},
rules: {
'react/jsx-filename-extension': [
1,
{ extensions: ['.js'] },
],
},
};
Eslint 版本 - 5.12.0
我该如何解决我的问题?
最佳答案
遇到了同样的问题。升级到 eslint 6.5.1
解决了它。
关于javascript - 填充 block 规则问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61760270/