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

[Bug]: jsx-newline still considering comments with { "prevent": true, "allowMultilines": true } #3526

Open
2 tasks done
bryanhaney-shipengine opened this issue Jan 25, 2023 · 0 comments
Labels

Comments

@bryanhaney-shipengine
Copy link

bryanhaney-shipengine commented Jan 25, 2023

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

Per #3493, this has been reported as fixed, but I am still seeing Multiline JSX elements should start in a new line when a comment is above a multiline JSX block.

  • config:
    "react/jsx-newline": ["warn", { "allowMultilines": true, "prevent": true }],

  • example of invalid code:

{/* fake-eslint-disable-next-line react/forbid-component-props */}
<div>
  <p>Cool Beans</p>
  <p>Sweet</p>
</div>
  • example of code that passes:
{/* fake-eslint-disable-next-line react/forbid-component-props */}
<div>Cool Beans</div>

Expected Behavior

Comments above multiline JSX blocks should be ignored if jsx-newline is enabled with config options: { "prevent": true, "allowMultilines": true }

I expect this code to pass:

{/* fake-eslint-disable-next-line react/forbid-component-props */}
<div>
  <p>Cool Beans</p>
  <p>Sweet</p>
</div>

eslint-plugin-react version

v7.32.1

eslint version

v8.28.0

node version

v17.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant