Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(eslint-plugin): [member-ordering] add support for grouping readonly fields#6349
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(eslint-plugin): [member-ordering] add support for grouping readonly fields#6349
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nx-cloudbot commentedJan 18, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the PR,@IronGeek! 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 onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedJan 18, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site settings. |
codecovbot commentedJan 18, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@## main #6349 +/- ##==========================================+ Coverage 88.62% 91.28% +2.65%========================================== Files 382 366 -16 Lines 12883 12461 -422 Branches 3787 3656 -131 ==========================================- Hits 11418 11375 -43+ Misses 1124 772 -352+ Partials 341 314 -27
Flags with carried forward coverage won't be shown.Click here to find out more.
|
JoshuaKGoldberg left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
A good start - thanks for getting this PR up! 🙌
Requesting changes on more test coverage & handling index signatures.
Aside: this rule gets more complicated and hard to deal with in every PR. But I don't see a way around it 😞. This comment isn't actionable and you can ignore my sadness. I'm just ... musing.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
JoshuaKGoldberg left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Whew, looks good to me! Thanks@IronGeek! 🙌
In theory one might want something likereadonly-method, for cases like{ readonly A: () => void }. But that can be a feature add if requested after this PR. The rule is (and already was) complex enough as it is.
JoshuaKGoldberg commentedMar 13, 2023
Btw, sorry for the month-long wait time. This fell off my radar. After the v6 release I'm hopeful we can work on#6033 as a process improvement so it doesn't happen again. |
PR Checklist
Overview
This PR introduces new member attribute/type/Kind:
readonly-field, a superset offield, which denotes all fields with readonly modifiers. This makes it possible to group/ sort fields based on their readonly modifiers and optionally with their Accessibility, and or Scope too.Like other member types,
readonly-fieldcan also be joined with accessibility and scope attributes to create more specific type; the following is the complete combination ofreadonly-fieldwith Scope and Accessibility introduced in this PR:For example, with this configuration the following code would be treated as valid:
{"rules": {"@typescript-eslint/member-ordering": ["error", {"default": ["decorated-readonly-field", ["public-readonly-field","readonly-field"]"protected-readonly-field","private-readonly-field","abstract-readonly-field","field" ] } ] }}