Closed
Description
Is there an existing issue for this?
- I have searched the existing issues and my issue is uniqueMy issue appears in the command-line and not only in the text editor
Description Overview
export default () => <h1>
<span>
hello
</span>
</h1>;
No fix applied
Expected Behavior
Auto fix correct code to:
export default () => (
<h1>
<span>
hello
</span>
</h1>
);
eslint-plugin-react version
v7.32.2
eslint version
v8.35.0
node version
v18.14.2
Activity
ljharb commentedon Mar 4, 2023
It's not a bug that a rule doesn't autofix, to be clear - not all rules autofix.
That said, it'd be great to add autofixing to this rule.
coderaiser commentedon Mar 4, 2023
I see that the rule has some code that does autofix, also documentation mentioned this.
ljharb commentedon Mar 4, 2023
ah yes, you're right, everything is passing a fixer, so there's something wrong here.
burtek commentedon Jan 9, 2024
Tried replicating this, but it fixes that example piece of code correctly for me 🤔
ljharb commentedon Jan 10, 2024
@burtek with what config? The test case I can get passing autofixes to:
(note the parens not being on their own lines)
burtek commentedon Jan 10, 2024
Oh wait, missed the part where parens should be on separate lines. Will see if I can fix it quickly
burtek commentedon Jan 10, 2024
Wait, but with what config @ljharb ? Default is
parens
so it works as expected. If I setarrow: 'parens-new-line'
it autofixes correctly...EDIT: see attached PR with tests
jsx-wrap-multilines
: passing tests #3676[Tests] `jsx-wrap-multilines`: passing tests
191 remaining items
Update dependency eslint-plugin-react to v7.37.4
Update dependency eslint-plugin-react to v7.37.4