-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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 compiler leaves trailing whitespace in object definitions #3553
Comments
You should be running your linters on source code (not generated code). Generated code generally should not be checked into a repository, should not be linted, etc. For this reason, this is probably pretty low priority. That said, if you'd like to submit a pull request, it would likely be considered. |
@JSFB We've tended to recommend linting after running through JSX as that's what FB does and it preserves line numbers, etc. |
Eeeh, That would mean that if someone's lint rules state that there must be a space between a function name and the open pren, that the linter would fail. Or any number of potential lint rules that happen to conflict with whatever the transpiler produces. You can't win, because people's linting rules can be mutually exclusive and thus there is no possible transpiler output that will pass all linters. Better to lint what the human is actually reading/editing. |
It's true, but then your linter needs to understand JSX. Now there are some (particularly eslint) but there weren't a year ago. |
Yep, I agree :). |
I agree that supporting the all of the various linting options would be an exercise in futility. I brought this one up because it appears to be a bug being that it doesn't add the trailing white space in any other instance I could find. |
Yeah, having the transpiler produce trailing whitespace probably wasn't intentional, but it's not a high-priority bug (primarily since it's generated code and thus not intended for human consumption). Like I said, we'd likely accept a pull request if you'd like to fix it :). |
#970, it's non-trivial to fix in the generator and was left as-is for now. |
JSX compilation is now handled by babel, which I think renders this issue no longer applicable. |
Assuming the following render call.
The generated output.
You'll notice that there is a trailing white space on the
serviceCount
andclosed
properties which is causing issues for linters which don't allow trailing white space.The text was updated successfully, but these errors were encountered: