-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix jsx-indent to not check lines starting by literals (fixes #900)
- Loading branch information
Showing
2 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
798f2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we want to not touch literals indentation? That should be fixed too (or at least, reported).
798f2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing it require to modify the literal and I did not find a good way to do it yet. And reporting it is problematic too, since line breaks are considered part of the Literal.
So for now I chose to ignore them.
798f2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with reporting it and leaving it unfixed? I'd rather have some errors unfixable than have them suppressed :-/
798f2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since line breaks are considered part of the Literal the error will be reported on the wrong line.
Here the literal is
\nbar
and the error will be reported on line 1. Also just detecting indentation errors on literals is not so easy.798f2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see. tbh i think an error on the wrong line is better than no error, but i understand a bit better now.