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
assert-arg-order: Rename to no-invalid-debug-function-arguments
and detect invalid usages of deprecate
and warn
too
#364
assert-arg-order: Rename to no-invalid-debug-function-arguments
and detect invalid usages of deprecate
and warn
too
#364
Conversation
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 think we should rename the rule as well, perhaps no-invalid-debug-arguments
or validate-debug-function-argument-order
?
@rwjblue good idea, I renamed the rule to |
|
||
assert(label, 'Label must be present.'); | ||
warn(label, 'Label must be present.'); | ||
deprecate(title, 'Title is no longer supported.'); |
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.
@bmish I think deprecate()
is supposed to always have a third argument (an options hash).
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.
Good point, added the third argument to both warn
and deprecate
.
…guments' to also detect invalid usages of 'deprecate' and 'warn'.
thanks again @bmish! one small potential improvement would be to not show the generic error message, but instead, show an error message mentioning the debug function that you actually used. |
no-invalid-debug-function-arguments
and detect invalid usages of deprecate
and warn
too
Renames the
assert-arg-order
rule tono-invalid-debug-function-arguments
. Generalizes it to detect theassert
argument order mistake along with two other similar functions (deprecate
andwarn
).Requested by @Turbo87.