-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(no-unlocalized-strings): remove default configuration #78
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
- Coverage 96.61% 96.49% -0.12%
==========================================
Files 10 10
Lines 413 371 -42
Branches 118 101 -17
==========================================
- Hits 399 358 -41
+ Misses 14 13 -1 ☔ View full report in Codecov by Sentry. |
8b694e5
to
f70111e
Compare
@@ -47,6 +47,8 @@ export default [ | |||
] | |||
``` | |||
|
|||
We also recommend enabling the [no-unlocalized-strings](docs/rules/no-unlocalized-strings.md) rule. It’s not enabled by default because it needs to be set up specifically for your project. Please check the rule's documentation for example configurations. |
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 can see why you want to go in this direction, but personally I had a lot of help from the defaults, and might have been hesitant to even try to use the rule if faced with a custom setup.
UPPERCASE_LETTERS being ignored was fine imo. My 10/10 experience would be what we had, including the ability to override such specifics if desired (unsure how feasible that is).
Either way, I'm a bit wary here, thinking that this PR may be a move away from a 9/10 out of the box experience which frankly is pretty good.
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 problem is a could not come up with a good way to override defaults. So we have two situations:
- When user ok with provided defaults and want to add more specificity for the project
- User is not ok with defaults and want to revert some of the buil-in rules (that already happened few times, saying from issues)
First case is already supported, we can extend the defaults.
The second case is a bit trickier, you need to give a way for user to choose what is going to happen, override or extend? This either brings more complicated structure of every option or double of options (ignorePoperty, ignorePropertyOverride). I don't like both of variants, actually.
That's why I decided to give a blank list, so there is nothing to override and it's pretty configurable. Also, it gives much more clarity about what exactly is ignored
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.
Solid reasoning.
Your example is thorough and should be easy enough to copy paste and run with. I might have been further encouraged if this language
You can use the following config as a starting point and then adjust it for your project
was slightly more assertive, i.e. officially recommending it, or mentioning it's history as the de facto-rule set before opening up for configuration.
…nd ignoreVariable into ignoreNames
@andrii-bodnar this one is ready to be merged. |
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.
@timofei-iatsenko thank you!
Quote myself:
This will fix
And possible many more issues in the future regarding the defaults.
What was done:
ignoreAttribute
,ignoreProperty
andignoreVariable
options were merged into singleignoreNames
strictAttribute
option removed. It didn't work properly, and now it's not needed because the user can override defaults more naturally (that was an original request for this option).msg
andselectOrdinal
functionsBreaking Changes
ignoreFunction
option was renamed toignoreFunctions
ignoreAttribute
,ignoreProperty
andignoreVariable
options were merged into singleignoreNames
strictAttribute
option removed.