Closed whatisaphone closed 7 years ago
This is basically the same as https://github.com/palantir/tslint-react/issues/79#issuecomment-289923337 and I would absolutely accept a PR to make the rule more lenient here.
Whoops sorry, I tried searching but clearly I didn't search well enough. I'll take the liberty of closing this as a dup
React 16 allows you to return an array from a render function, which brings up a new pattern that's possibly worth supporting. The rule flags the first div in this code as an error due to missing parentheses:
The suggested fix wastes a lot of space and doesn't gain anything readability-wise:
What do you think about changing the rule to support cases like this? My suggested criteria is that the opening and closing (if present) angle brackets starting in the same column should cause the code to be OK under this rule. From my brief glance at the tests, all the cases would stay the same under this change.