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

Allow multiline JSX expressions when prevent option is true: jsx-newline #3311

Merged

Conversation

TildaDares
Copy link
Contributor

@TildaDares TildaDares commented Jun 21, 2022

Fixes #3033

This is an initial PR to confirm that this is the change required to allow multi-lines in the jsx-newlines rule.

@TildaDares TildaDares marked this pull request as draft June 21, 2022 10:41
@TildaDares TildaDares changed the title Draft: allow multiline when prevent option is true WIP: allow multiline when prevent option is true Jun 21, 2022
@TildaDares
Copy link
Contributor Author

@ljharb Can you please take a quick look to see if I'm on the right track? Thank you!!

@codecov
Copy link

codecov bot commented Jun 21, 2022

Codecov Report

Merging #3311 (2f8fba8) into master (ed26b15) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

❗ Current head 2f8fba8 differs from pull request most recent head 8887a19. Consider uploading reports for the commit 8887a19 to get more accurate results

@@            Coverage Diff             @@
##           master    #3311      +/-   ##
==========================================
- Coverage   97.70%   97.56%   -0.14%     
==========================================
  Files         123      123              
  Lines        8746     8759      +13     
  Branches     3168     3172       +4     
==========================================
+ Hits         8545     8546       +1     
- Misses        201      213      +12     
Impacted Files Coverage Δ
lib/rules/jsx-newline.js 100.00% <100.00%> (ø)
lib/rules/no-arrow-function-lifecycle.js 88.52% <0.00%> (-9.84%) ⬇️
lib/rules/jsx-curly-spacing.js 91.17% <0.00%> (-2.95%) ⬇️
lib/rules/jsx-props-no-spreading.js 95.65% <0.00%> (-2.18%) ⬇️
lib/util/componentUtil.js 97.33% <0.00%> (-1.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed26b15...8887a19. Read the comment docs.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall!

lib/rules/jsx-newline.js Outdated Show resolved Hide resolved
lib/rules/jsx-newline.js Outdated Show resolved Hide resolved
lib/rules/jsx-newline.js Outdated Show resolved Hide resolved
lib/rules/jsx-newline.js Outdated Show resolved Hide resolved
@TildaDares TildaDares marked this pull request as ready for review June 23, 2022 21:04
@TildaDares TildaDares changed the title WIP: allow multiline when prevent option is true Allow multiline JSX expressions when prevent option is true: jsx-newline Jun 23, 2022
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@ljharb ljharb force-pushed the add-multiline-option-in-newline-rule branch 2 times, most recently from 7a1634a to 8887a19 Compare June 28, 2022 17:54
@ljharb ljharb merged commit 8887a19 into jsx-eslint:master Jun 28, 2022
@TildaDares TildaDares deleted the add-multiline-option-in-newline-rule branch June 28, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] react/jsx-newline
2 participants