Skip to content

fix(eslint-plugin): [member-ordering] get accessor member name & take into account abstract and decorator #9775

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

Merged
merged 6 commits into from
Aug 12, 2024

Conversation

OlivierZal
Copy link
Contributor

@OlivierZal OlivierZal commented Aug 10, 2024

PR Checklist

Overview

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @OlivierZal!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Aug 10, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 6fcd519
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66ba2da6ca43af0008c563a7
😎 Deploy Preview https://deploy-preview-9775--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Aug 10, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 6fcd519. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@OlivierZal OlivierZal changed the title Add getMemberName for accessors fix(rule): [member-ordering] get accessor member name Aug 11, 2024
@OlivierZal OlivierZal changed the title fix(rule): [member-ordering] get accessor member name fix(eslint-plugin): [member-ordering] get accessor member name Aug 11, 2024
@OlivierZal
Copy link
Contributor Author

@bradzacher
Copy link
Member

image
It's a flake

@typescript-eslint typescript-eslint deleted a comment from github-actions bot Aug 11, 2024
@OlivierZal OlivierZal force-pushed the patch-1 branch 2 times, most recently from 90f1067 to 9869078 Compare August 11, 2024 20:36
@OlivierZal
Copy link
Contributor Author

OlivierZal commented Aug 11, 2024

Works for non-abstract accessors:

test1 non-abstract

Works for abstract accessors:

test2 abstract

@OlivierZal OlivierZal marked this pull request as ready for review August 11, 2024 20:57
@OlivierZal OlivierZal changed the title fix(eslint-plugin): [member-ordering] get accessor member name fix(eslint-plugin): [member-ordering] get accessor member name & take into account abstract and decorator Aug 11, 2024
@OlivierZal
Copy link
Contributor Author

OlivierZal commented Aug 11, 2024

Test with non-abstract accessor and abstract accessor:

test abstract 2

Test with non-decorated accessor and decorated accessor:

test decorated

Copy link

codecov bot commented Aug 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.91%. Comparing base (fbe5f2d) to head (6fcd519).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9775      +/-   ##
==========================================
- Coverage   87.92%   87.91%   -0.02%     
==========================================
  Files         402      402              
  Lines       13726    13725       -1     
  Branches     3999     3998       -1     
==========================================
- Hits        12069    12066       -3     
- Misses       1351     1352       +1     
- Partials      306      307       +1     
Flag Coverage Δ
unittest 87.91% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ackages/eslint-plugin/src/rules/member-ordering.ts 96.80% <100.00%> (-0.93%) ⬇️
...plugin/src/rules/no-unnecessary-type-parameters.ts 94.85% <100.00%> (ø)
packages/eslint-plugin/src/util/misc.ts 98.63% <ø> (ø)

@Josh-Cena
Copy link
Member

Could you add real test cases in the tests folder too?

@OlivierZal
Copy link
Contributor Author

OlivierZal commented Aug 12, 2024

@Josh-Cena, added tests (and fixed format because this commit broke main).

Now it's ready to merge.

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Kid from the Brady Bunch saying "That's swell!"

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Aug 12, 2024
@OlivierZal
Copy link
Contributor Author

Thanks @JoshuaKGoldberg, is there any step I need to perform after approval is granted?

if (
reference.identifier.parent.type === AST_NODE_TYPES.TSTypeReference
) {
if (reference.identifier.parent.type === AST_NODE_TYPES.TSTypeReference) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, why is this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Josh-Cena, explained there

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

@Josh-Cena
Copy link
Member

Josh-Cena commented Aug 12, 2024

It seems wholly unnecessary to enforce up-to-date branches before merging in most cases, FWIW.

(Nothing to do with this PR in particular)

@JoshuaKGoldberg JoshuaKGoldberg merged commit 3d9ae44 into typescript-eslint:main Aug 12, 2024
59 checks passed
@JoshuaKGoldberg
Copy link
Member

any step I need to perform after approval is granted

Nothing on your end! Just being excited in general, I suppose. 😄

Thanks for this! Merged & will be released in our weekly release later today.

@OlivierZal OlivierZal deleted the patch-1 branch August 12, 2024 16:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [@typescript-eslint/member-ordering] no error raised when accessors not sorted by alphabetical order
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy