question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autofix for jsx-sort-props doesn't respect comments

See original GitHub issue

Autofix for jsx-sort-props doesn’t respect comments.

For example:

<foo
  b={1}
  // comment for a
  a={0}
/>

will be fixed like this:

<foo
  a={0}
  // comment for a
  b={1}
/>

But I think it should be like this:

<foo
  // comment for a
  a={0}
  b={1}
/>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
7rulnikcommented, Aug 2, 2019

So, something like this? Ok, I will take a look

<input
  a
  a
  b
  b
  c
  c
  // fofof
  f
/>
0reactions
ljharbcommented, Aug 4, 2022

@ROSSROSALES I think the comments will be attached as a property on an adjacent node of another kind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-react/CHANGELOG.md at master
... jsx-no-leaked-render : autofix nested "&&" logical expressions (#3353 @hduprat); jsx-sort-props : sorted attributes now respect comments ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found