-
-
Notifications
You must be signed in to change notification settings - Fork 420
Refactor the prevent-abbreviations rule
#337
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
Refactor the prevent-abbreviations rule
#337
Conversation
futpib
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.
👍 for the quick follow-up
rules/prevent-abbreviations.js
Outdated
| .map(originalIsInPascalCase ? pascalCase : name => name) | ||
| .sort(); | ||
| }; | ||
| let options = [[]]; |
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.
this can be quick loop from 0 to limit, I will figure out later
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.
It's cartesian product, I've done this before but forgot how to calculate
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.
Why is changing getWordByWordReplacements even necessary here?
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 want have a function can get replacements only by word, no matter what cases, file names is more complicated than variable names
|
@futpib ready for review |
prevent-abbreviationsprevent-abbreviations rule
|
Thanks, @fisker 👍 |
What I have done:
1, refact
getNameReplacements, It should handle more kinds of strings, hope @futpib don't mind2, update test fix #336 review