javascript - 填充 block 规则问题

标签 javascript reactjs visual-studio-code eslint

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

相关文章:

javascript - 每当可选 Prop 发送到子组件时显示错误

python - 如何使用 VSCode 在虚拟环境中调试 python 代码?

javascript - 在 Highcharts 中绘制 2 条线。 JSON格式错误?

javascript - 无需服务器的 Cordova/PhoneGap 推送通知

javascript - 从 POST 请求将文件保存到 Web 服务器

javascript - "Serverless-offline: route not found."在离线模式下运行 AWS Lambda 函数

css - react , flex 盒子 : I want my div to transitionally rise from the bottom of a flex container

javascript - ReactJS错误警告

go - 使用 go 模块后,IDE 无法跟踪我的代码

visual-studio-code - 防止 VS Code 多行注释中的尾随和前导空格