-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): replace auto-fix of class literal property style rule with suggestion #7054
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
fix(eslint-plugin): replace auto-fix of class literal property style rule with suggestion #7054
Conversation
Thanks for the PR, @Melandra! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7054 +/- ##
==========================================
+ Coverage 87.38% 87.41% +0.02%
==========================================
Files 386 386
Lines 13193 13216 +23
Branches 3867 3879 +12
==========================================
+ Hits 11529 11553 +24
+ Misses 1298 1296 -2
- Partials 366 367 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
messages: { | ||
preferFieldStyle: 'Literals should be exposed using readonly fields.', | ||
preferFieldStyleSuggestion: | ||
'Try replacing the literals with readonly fields.', |
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.
I wasn't sure what messaging to use here, I'm open for other suggestions 🙂
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.
Ah yeah these can be tricky. Searching around other rules that have hasSuggestions: true
, we normally go with language like "Do X with Y". Here I think that'd be:
- 'Try replacing the literals with readonly fields.'
+ 'Replace the literals with readonly fields.'
What do you think about that?
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.
Yes, that sounds good, I've updated both suggestion messages.
This reverts commit a05601f.
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.
🙌 The code looks great - love a clean swap like this one!
Just requesting changes to suggest a change to the text, as you brought up. Thoughts?
If you're happy with the suggestion or have one of your own then ✅ we can merge!
(sorry for the delay in reviewing - we've been focusing on v6
...)
No worries 🙂 |
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.
🙌 Super, thanks @Melandra!
PR Checklist
Overview
This PR changes the fixer for the class literal property style rule in the eslint-plugin package from an autofixer to a suggestion fixer.