We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Node's assert functions allow for passing in an optional message. I'd like a way to enforce passing in that message.
For example, assert takes a value and an optional message.
assert(foo); assert(foo, 'Foo is required')
Syncing between error logs and code is far easier when your error message is Foo is required rather than undefined == true
Foo is required
undefined == true
Warns about a potential problem
// Error/warn assert(foo); assert.equal(foo, bar); // Good assert(foo, 'Foo is required'); assert.equal(foo, bar, 'Foo and Bar are not equal');
No response
The text was updated successfully, but these errors were encountered:
👍 I am in favour of this.
Thank you for the issue :)
Sorry, something went wrong.
No branches or pull requests
Rule details
Node's assert functions allow for passing in an optional message.
I'd like a way to enforce passing in that message.
For example,
assert
takes a value and an optional message.Syncing between error logs and code is far easier when your error message is
Foo is required
rather thanundefined == true
What type of rule is this?
Warns about a potential problem
Example code
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: