Skip to content
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-curly-spacing] False positive with render props #140

Closed
danielkcz opened this issue Jan 30, 2018 · 8 comments
Closed

[jsx-curly-spacing] False positive with render props #140

danielkcz opened this issue Jan 30, 2018 · 8 comments
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier help wanted Type: Enhancement
Milestone

Comments

@danielkcz
Copy link

The following code is causing false positive on this rule.

tslint-react: 3.4.0

<Route
  children={({ location, history }) =>
    store.auth.isAuthenticated ? (
      <Redirect to={location.state.from} />
    ) : null
  } // Error here: There should be no space before } (jsx-curly-spacing)
/>

I might add that code is auto formatted by Prettier so I cannot write it differently :)

/cc @bolatovumar

@adidahiya
Copy link
Contributor

There are many tslint rules which are incompatible with prettier. I suggest you use tslint-config-prettier to avoid any conflicts.

@danielkcz
Copy link
Author

danielkcz commented Jan 30, 2018

@adidahiya Well, it was merely a side note that I am using Prettier :) Imagine if someone would format their code this way manually and get the same error. In that case it's obviously a bug in the rule, don't you agree?

@adidahiya
Copy link
Contributor

sure, I guess so... would accept PRs to fix this false positive. typically the rules in tslint-react are all used together, and that code wouldn't pass jsx-no-multiline-js anyway...

@bolatovumar
Copy link
Contributor

bolatovumar commented Jan 30, 2018 via email

jkillian pushed a commit that referenced this issue Jun 11, 2018
* Fix issue #140

The problem was caused by `getTokensCombinedText` returning an incorrect
slice which caused the multiline check to fail.

* tweak formatting
@peter50216
Copy link

Hi,
Can a new minor version be released that include this fix? Thanks.

@fqlx
Copy link

fqlx commented Nov 7, 2018

+1, seeing this issue as well.

@evenfrost
Copy link

Same here.

@bartvde
Copy link

bartvde commented Mar 8, 2019

Can we please have a release that fixes this?

@adidahiya adidahiya added the Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier label Mar 12, 2019
@adidahiya adidahiya added this to the 3.7.0 milestone Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier help wanted Type: Enhancement
Projects
None yet
Development

No branches or pull requests

7 participants