【问题标题】:Padding-block rule issue填充块规则问题
【发布时间】: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.1eslint-config-airbnb-base 14.2.0 的问题相同。

标签: javascript reactjs visual-studio-code eslint


【解决方案1】:

有同样的问题。升级到 eslint 6.5.1 解决了它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-25
    • 2011-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多