相关疑难解决方法(0)

在 EsLint 中禁用 Reactjs 中的“react / jsx-props-no-spreading”错误

安装 EsLint 后,我​​看到的错误之一如下:

Prop spreading is forbiddeneslint(react/jsx-props-no-spreading)

I want to create a rule in the EsLint configuration to ignore this error but the examples I found do not work.

This is the format to create a global exception:

...
"react/jsx-props-no-spreading": [{
    "html": "ignore" / "enforce",
    "custom": "ignore" / "enforce",
    "exceptions": [<string>]
}]
...
Run Code Online (Sandbox Code Playgroud)

And this is the format to create an exception in a specific file:

{
  "rules": {...},
  "overrides": [
    {
      "files": ["*-test.js","*.spec.js"],
      "rules": {
        "no-unused-expressions": "off"
      }
    } …
Run Code Online (Sandbox Code Playgroud)

reactjs eslint redux

13
推荐指数
2
解决办法
2万
查看次数

标签 统计

eslint ×1

reactjs ×1

redux ×1