-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Improve report location calculations #7
Comments
This is working as intended, although there is some room for improvement. The plugin just compares the original text to the prettier-formatted text, and reports an error at the first location where the two strings differ. At the moment, it doesn't generate line-by-line diffs. I'm open to a PR to compare the two strings more intelligently. |
I don't see how the location problem is related to my initial report 😄 I think the wording makes me expect that it is an exhaustive report that I get, and it is not in sync with my expectations as a user, that I get an error report worded like that, and only one of them. I realize why it's hard to do anything about, but an alternative solution that wouldn't cause this user experience WTF moment could be to just have it fail with an error on line 1 character 1:
|
Hmm, I'm not sure I want to just output an error on line 1 character 1, because in some cases maybe the error message is useful (e.g. if someone is missing a semicolon). Making the error message clearer seems like it could be a good idea though. |
This will be fixed once #21 is merged. |
I just published [email protected] which fixes this |
Given this example:
Prettier wants it formatted as:
But running eslint gives me the following report:
I expected an error to be reported on both line 5 and 11, not just line 5. If I proceed to actually run prettier, both are fixed up as expected.
Other rules continue to work as expected, but this plugin and it's rule will only report the first problem.
The text was updated successfully, but these errors were encountered: