-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
disable-next-line doesn't work with react rules in JSX #2369
Comments
This seems like more of an issue for eslint itself, not for this plugin - how eslint parses JSX, and override commands, is entirely within eslint's purview. |
How come it only happens with |
That's a fair question; it might depend on the rule and what precisely it's warning on. Can you provide an example of core rule jsx overrides that work how you expect? |
Yeah, |
ah thanks, sorry i missed that. It might be some difference in how |
I cannot reproduce this bug. |
@felixfbecker can you provide |
Here ya go:
Failure seen just now: |
@cmrigney in your case, you're ensuring that |
I have got the same issue, too. /* eslint-disable */ for multi-line does not work either. |
this is a bit stale, but since it's not closed, and in case anyone else runs into this thread, have you tried surrounding the rule in brackets, e.g. could look like this:
or this:
I just did something like that in a project after being stuck for a while and it worked. |
When using
// eslint-disable-next-line react/jsx-no-bind
inside JSX, the violation is not ignored as expected.Ignoring a built-in rule, e.g.
arrow-parens
, works as expected (demo). I am only seeing this withreact/
rules, likereact/jsx-no-bind
orreact/forbid-dom-props
.To reproduce, lint the following code snippet with
If you move the prop up to be the first prop, it works:
Any other rule works too:
eslint@5.16.0
eslint-plugin-react@7.14.3
The text was updated successfully, but these errors were encountered: