-
-
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
jsx-wrap-multiline eslint crash #2100
Comments
https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-wrap-multilines.js#L165 implies that either the before or after token was null, and not being checked. Added in #1576 / cc @sharmilajesupaul |
in this case it was the after token |
there's 3 fixes that I'm aware of:
but maybe there's a smarter use of getTokenAfter (or maybe the bug is definitely there) or a smarter use of replaceTextRange that I'm not aware of that may be worth implementing. anyway rule is yours, pick your favourite fix I'll be happy to send the PR. any choice you pick --fix works like a charm, my choice would be digging on getTokenAfter or replaceTextRange but I really don't know where to start searching for those |
I’m really not sure :-) as long as the fix comes with lots of test cases, at least some of which fail absent the fix, i think maybe 1 > 2 > 3? |
Thanks all for the great library, I use it a lot.
Recently I have discovered a problem with the rule jsx-wrap-multiline that throws exception during eslint execution.
I have a really bad formatted file:
the error I receive is
I'll attach a basic example
jsx-wrap-multiline-issue.zip
There are a few ways of patching this error and I would like to send a PR for it, but I'm not sure how would you like the fix to be implemented. Also I'm not aware of possible implications.
Let me know if I can help you
The text was updated successfully, but these errors were encountered: