gpt4 book ai didi

javascript - 填充 block 规则问题

转载 作者:行者123 更新时间:2023-12-05 06:17:10 30 4
gpt4 key购买 nike

我对基本的 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/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com