-
Notifications
You must be signed in to change notification settings - Fork 888
Suggestion for no-magic-numbers #4412
Comments
For me at least, I still want no-magic-numbers to catch this case. Yes you know what the number represents, but by forcing you to define the number outside of the JSX, it could enable you to better define how you came up with the number, allow easy exporting, etc. That said, I could see this as a new rule option - to disable the rule within JSX. However, I would disagree with setting it as default. |
Good idea. So, you may add the new rule to repository |
@fwh1990 this repository could take in a pull request to add the option to the |
I appended option ts.SyntaxKind.JsxAttribute and ts.SyntaxKind.JsxAttributes to Rule.ALLOWED_NODES,but nothing changed. Would you please add this enhancement yourself? |
fixed by #4460 |
Rule Suggestion
Is your rule for a general problem or is it specific to your development style?
A general problem.
What does your suggested rule do?
no-magic-numbers
should not report error when using in tsx attribute.List several examples where your rule could be used
Because we both understand what the numbers mean.
Additional context
No.
The text was updated successfully, but these errors were encountered: