【发布时间】:2020-05-12 19:25:08
【问题描述】:
我对基本的 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 7.3.1和eslint-config-airbnb-base 14.2.0的问题相同。
标签: javascript reactjs visual-studio-code eslint