-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Error while configuring react/jsx-props-no-spreading #2387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is intentional; there's no point in using the rule if you're ignoring everything and have no exceptions: https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-props-no-spreading.js#L48-L63 If you add an exception, or change one of the ignores to "enforce", it should work. |
I understand that it would be pointless, but unfortunately it's part of the airbnb rules that comes with its extension, in any case, after keeping it for a while I can already see its benefit, thank you! |
The airbnb config doesn’t ignore both kinds of components. |
No, as in, this rule came as part of the airbnb config, and I was trying to turn it off. |
Set it to "off" then :-) |
Thanks for teaching me that :P
|
Cannot pass a configuration object that ignores everything and has no exception jsx-eslint/eslint-plugin-react#2387
How do u switch it to off? |
No worries got it, thanks |
Just for the record:
For setting it off you can use either any of the following
|
This may seem obvious to most people but wasn't to me, this can be set up in an
|
"rules": {
"react/jsx-props-no-spreading": [
"error",
{
"explicitSpread": "enforce",
"html": "ignore",
"custom": "ignore",
"exceptions": []
}
]
}
This doesn't work for some reason.. What am I missing? @ljharb |
the rule does not allow an empty exceptions array: https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-props-no-spreading.js#L66 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Back in 2024 and this is not working:
I want to specifically only ban
|
@divmgl what version of the plugin are you using? |
|
Just updated to latest and it's still occurring unfortunately. |
Sure! |
While 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
Actual:
Getting the following error
Package versions:
The text was updated successfully, but these errors were encountered: