palantir / tslint-react

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

New rule suggestion: no-spaces-in-singleline #188

Closed vjsingh closed 5 years ago

vjsingh commented 6 years ago

Currently, the following will cause a generic React Native error on Android, with no line number or file. This makes debugging difficult:

<Tag> {children}</Tag> (see https://github.com/facebook/react-native/issues/18773)

It would be nice if tslint could catch these extra spaces in single-line JSX for me.

Alternatively, a more brutish approach could be to disallow single line JSX entirely, but that isn't a great solution.

*by single-line JSX I mean lines with the opening and closing tags on the same line

adidahiya commented 5 years ago

Seems to be addressed in ESLint according to that issue thread you linked. Also closing due to #210

vjsingh commented 5 years ago

Fair enough, thanks @adidahiya