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

[New] jsx-closing-tag-location: add line-aligned option #3777

Merged

Conversation

kimtaejin3
Copy link
Contributor

@kimtaejin3 kimtaejin3 commented Jul 3, 2024

Fixes #3740

I added new options to jsx-closing-tag-location: line-aligned and tag-aligned (default).

With the line-aligned option, the following code would be accepted:

const test = <div>
            Hello World
</div>

Users can use the tag-aligned option to ensure that the following code is accepted:

const test = (
        <div>
            Hello World
        </div>
)

What I did:

  1. Added code for the new options, including a error message.
  2. Updated the documentation to explain the new options.
  3. Added test cases for the new options and verified that they all pass.

Please let me know if there are any improvements needed. I am happy to fix them!

I am honored to contribute to this project.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.76%. Comparing base (9bf81af) to head (2fdf0b4).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3777      +/-   ##
==========================================
- Coverage   97.77%   97.76%   -0.01%     
==========================================
  Files         135      135              
  Lines        9655     9680      +25     
  Branches     3500     3515      +15     
==========================================
+ Hits         9440     9464      +24     
- Misses        215      216       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ljharb ljharb force-pushed the feature/jsx-closing-tag-location branch from 446dc74 to a1a3464 Compare July 4, 2024 04:08
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.

Seems good! I've rebased it. Only thing left is the uncovered lines.

@ljharb ljharb marked this pull request as draft July 4, 2024 04:09
@ljharb ljharb force-pushed the feature/jsx-closing-tag-location branch from a1a3464 to b381547 Compare July 4, 2024 04:43
@ljharb ljharb force-pushed the feature/jsx-closing-tag-location branch from c5c7494 to d0f6512 Compare July 4, 2024 15:41
@kimtaejin3 kimtaejin3 requested a review from ljharb July 5, 2024 06:44
@kimtaejin3 kimtaejin3 marked this pull request as ready for review July 10, 2024 04:25
@ljharb ljharb force-pushed the feature/jsx-closing-tag-location branch from d0f6512 to 7be3ee5 Compare July 15, 2024 18:22
@ljharb
Copy link
Member

ljharb commented Jul 15, 2024

looks like tests are failing

@ljharb ljharb marked this pull request as draft July 15, 2024 19:19
lib/rules/jsx-closing-tag-location.js Outdated Show resolved Hide resolved
lib/rules/jsx-closing-tag-location.js Outdated Show resolved Hide resolved
lib/rules/jsx-closing-tag-location.js Show resolved Hide resolved
lib/rules/jsx-closing-tag-location.js Outdated Show resolved Hide resolved
lib/rules/jsx-closing-tag-location.js Outdated Show resolved Hide resolved
lib/rules/jsx-closing-tag-location.js Outdated Show resolved Hide resolved
@kimtaejin3 kimtaejin3 force-pushed the feature/jsx-closing-tag-location branch from 39b8fed to 2fdf0b4 Compare July 16, 2024 03:20
@kimtaejin3 kimtaejin3 requested a review from ljharb July 16, 2024 06:18
@kimtaejin3 kimtaejin3 marked this pull request as ready for review July 16, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add "line-aligned" to react/jsx-closing-tag-location
2 participants