-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
tools: .eslintrc.js messages "default" typo style #22868
Conversation
* all methods and syntax keywords between backticks * written numbers
* moving /* eslint-disable max-len */
It seems a common style is already shared by all messages, what is the advantage of adding backticks? |
Actually, a single error message has it: https://github.com/nodejs/node/blob/master/.eslintrc.js#L163 so I thought that all should have it, or none, and if any new message is added it will probably follow the pattern of the others, I'm aware that it's a small change and it can not be that relevant(no problem in closing the pr). |
.eslintrc.js
Outdated
}, | ||
{ | ||
selector: 'ThrowStatement > CallExpression[callee.name=/Error$/]', | ||
message: 'Use new keyword when throwing an Error.', | ||
message: 'Use `new` keyword when throwing an Error.', |
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.
Nit: Add backticks around Error
as well?
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.
Added, it looks better in the sentence now
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'm not usually a fan of using markdown conventions (such as backticks around code) in places that aren't markdown, but I agree this improves readability, especially for the `new` keyword
one, so 👍 from me.
* Error object backtick
Landed in 4e09fc3 🎉 |
"Default" typo pattern for .eslintrc.js messages * all methods and syntax keywords between backticks * written numbers * moving /* eslint-disable max-len */ * Error object backtick PR-URL: #22868 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
"Default" typo pattern for .eslintrc.js messages * all methods and syntax keywords between backticks * written numbers * moving /* eslint-disable max-len */ * Error object backtick PR-URL: #22868 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
make all messages in .eslintrc.js follow a in common style
Checklist