Error while configuring react/jsx-props-no-spreading
See original GitHub issueWhile setting up my eslint rules, I ran into some issues when configuring jsx-props-no-spreading
Expected: Allow props spreading when the following rule is set
'react/jsx-props-no-spreading': ['error', {
html: "ignore",
custom: "ignore",
exceptions: [],
}],
Actual: Getting the following error
Error: .eslintrc.js: Configuration for rule “react/jsx-props-no-spreading” is invalid: Value {“html”:“ignore”,“custom”:“ignore”,“exceptions”:[]} should NOT be valid.
Package versions:
"eslint": "^6.2.0",
"eslint-plugin-react": "^7.14.3",
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Disable in EsLint "react / jsx-props-no-spreading" error in ...
I want to create a rule in the EsLint configuration to ignore this error but the examples I found do not work. This...
Read more >eslint-plugin-react/jsx-props-no-spreading.md at master - GitHub
Enforces that there is no spreading for any JSX attribute. This enhances readability of code by being more explicit about what props are...
Read more >Prop spreading is forbidden warning in React | bobbyhadz
The warning "Props spreading is forbidden" is caused when we use the spread syntax to unpack a props object when passing props to...
Read more >How to resolve eslint error: "prop spreading is forbidden" in a ...
ES lint discourages the use of prop spreading so that no unwanted/unintended props are being passed to the component.
Read more >Disable in EsLint “react / jsx-props-no-spreading” error in ...
I want to create a rule in the EsLint configuration to ignore this error but the examples I found do not work. This...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just for the record: If you wish to use the rule and wish to ignore instead of setting it
off
. This is how you should use: In the rule definition, all the fields are made compulsory and speciallyexceptions
is suppose to have an array of string not empty, so the declaration of rules goes like followFor setting it off you can use either any of the following
Set it to “off” then 😃