-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: add additional ESLint rules #8643
Conversation
@@ -918,7 +918,7 @@ Server.prototype.addContext = function(servername, context) { | |||
|
|||
var re = new RegExp('^' + | |||
servername.replace(/([\.^$+?\-\\[\]{}])/g, '\\$1') | |||
.replace(/\*/g, '[^\.]*') + | |||
.replace(/\*/g, '[^.]*') + |
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.
This is only tangentially related to this PR, but was this line supposed to have a double backslash? This line looks like it was supposed to be
.replace(/\*/g, '[^\\.]*')`
...but since it's in a string literal rather than a regex literal, the backslash before the dot isn't doing anything.
/cc @indutny based on git blame
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.
There is no actual difference between any of the three variants there, so we could just keep it as [^.]*
.
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.
LGTM
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.
LGTM
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.
LGTM
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.
LGTM
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.
LGTM
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.
LGTM
@not-an-aardvark I took the liberty of fixing the link to |
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.
LGTM
@not-an-aardvark : It looks like this is introducing a number of new linting failures that should be fixed up before it lands. |
58e1972
to
89ff183
Compare
Thanks for letting me know; I rebased/fixed the new linting errors. New CI: https://ci.nodejs.org/job/node-test-pull-request/4180/ (Planning to land this in a few hours if no one has objections.) |
Landed in b1b1978 |
PR-URL: #8643 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@keybase.io>
PR-URL: #8643 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@keybase.io>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
tools
Description of change
This enables the following ESLint rules, all of which are already followed in the vast majority of the codebase:
dot-location
: On multiline property access, require the dot to be placed next to the property name rather than the object name. (1 existing violation)no-useless-call
: Disallow unnecessaryFunction.prototype.call
expressions, e.g.foo.bar.call(foo)
. (0 existing violations)no-useless-escape
: Disallows characters in strings/regexes from being escaped with a backslash unless the backslash is actually doing something. (8 existing violations)no-void
: Disallowsvoid
expressions. (0 existing violations)no-with
: Disallowswith
statements. (0 existing violations)comma-style
: Require commas to be placed at the end of a line, rather than the beginning. (1 existing violation)computed-property-spacing
: When accessing a computed property (e.g.foo[bar]
), disallow spaces inside the square brackets. (2 existing violations)no-tabs
: Disallow tab characters. (1 existing violation)semi-spacing
: Disallow spaces before semicolons, and require spaces after semicolons. (2 existing violations)