palantir / tslint-react

:orange_book: Lint rules related to React & JSX for TSLint.
Apache License 2.0
749 stars 76 forks source link

Add jsx-space-before-trailing-slash rule #144

Closed no23reason closed 6 years ago

no23reason commented 6 years ago

Closes #125

r3nya commented 6 years ago

Love it and waiting for merge. :) Btw, thanks a lot for your job @no23reason!

no23reason commented 6 years ago

@adidahiya pinging you if we could please re-run the circleci build? I believe the failing build has nothing to do with my changes.

suchanlee commented 6 years ago

Thanks for the PR! Looks awesome. I will look into the build issue, probably sometime this weekend or early next week.

jkillian commented 6 years ago

Hey @no23reason, I was able to get your PR build working over at https://github.com/palantir/tslint-react/pull/164, it's merged now! Going to close this one out then

evaliyev commented 5 years ago

@suchanlee I was wondering why this rule was implemented as turn on/off rule? That is, instead of having options true/false that enforces or disables adding spaces, you could have options ["always", "never"] that give more control and can enforce both addition and removal on spaces.

If a project prefers writing self-closing tags as<Component/> that rule is useless. Am I missing something?

no23reason commented 5 years ago

@evaliyev I believe the original intent of this rule was to enforce the presence of the space, not its absence. However, if there really are projects that want to explicitly remove the space (I have never encountered one), this rule should be easy to extend.