-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add require-number-to-fixed-digits-argument
rule
#1288
Add require-number-to-fixed-digits-argument
rule
#1288
Conversation
Some rule names in this plugin could use the common |
I thought about it and checked core rules and other plugins, but seems |
I try to name almost all my lint rules with the following prefixes to make it clear what they are actually doing:
|
docs/rules/number-to-fixed-digits.md
Outdated
@@ -0,0 +1,37 @@ | |||
# Enforce using the digits argument with `Number#toFixed()` | |||
|
|||
It's better to make it clear what the value of the `digits` argument is when calling [Number#toFixed()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed). |
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.
We should mention the default here too, like #1294
I agree. I don't think it's worth renaming existing rules, but we should try to follow that in the future. |
👍 |
We could do this one too, since it's not released yet. |
Rename PR: #1295 |
Feel free to open a new issue with your suggestions on what rules should be renamed and we can consider it. |
…gin-unicorn into number-to-fixed-digits
number-to-fixed-digits
rulerequire-number-to-fixed-digit-argument
rule
# Conflicts: # readme.md
I forgot another reason I didn't add |
@fisker makes sense, I agree that if there's any chance we would want to generalize what the rule does, then your original name would be better. Feel free to revert if that's the case. However, in the past, I've also named rules |
Another example in core rules. The |
👍 , but for this rule, |
require-number-to-fixed-digit-argument
rulerequire-number-to-fixed-digits-argument
rule
|
I'll fix, what's your opinion about #1288 (comment) |
I think in general we should try to think upfront before adding a rule whether we're likely to add more stuff to it in the future, if not, I think it's fine to use a specific name with
We can still do this even when it's named |
…gin-unicorn into number-to-fixed-digits
Fixes #1245