-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
📎 Implement nursery/noIrregularWhitespace
- eslint/no-irregular-whitespace
#53
Comments
We should not implement this rule IMHO. We have the formatter that takes care of white spaces, and it could take care of the irregular ones too. |
Does the formatter normalize the irregular whitespace? |
I don't think so, but I don't see a reason why it shouldn't |
I think there's some validity to having this as a lint rule as well as the formatter auto-fixing them. The formatter can take care of all of the irregular spaces in regular code, but then it's still possible to have these space characters within strings, regexes, and comments, which I think would be incorrect for the formatter to change (it's more likely those characters are intentional in those places, or they at least have a significant meaning). |
I am unsure about that because there is some legitimate use of irregular whitespaces such as non-breaking spaces? |
I could see it being a non-recommended rule? There definitely are valid cases, but it would still catch a lot of accidental copy-paste issues. Like the formatter could just re-write them in normal code, but if it's a JSX text or inside of a string literal, then it's not safe to re-write because it might be intentional. But a lint rule could still warn that they are irregular characters in case that's not what the user wanted, and they can add an ignore comment if they really do want it. |
lint/noIrregularWhitespace
- eslint/no-irregular-whitespace
nursery/noIrregularWhitespace
- eslint/no-irregular-whitespace
can I get this one? |
I looked for how often the ESLint rule options are used, and all of the options (skipStrings, skipComments, skipRegExps, skipTemplates, and skipJSXText) are used only between 100 and 200 times, so for now I'm going to implement only the default behavior of the rule. |
Description
Implement no-irregular-whitespace.
Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.
The text was updated successfully, but these errors were encountered: