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
Chore: enable a modified version of multiline-comment-style rule on codebase #9452
Conversation
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.
Just left one question, otherwise basically LGTM. Thanks!
tests/bin/eslint.js
Outdated
it("has exit code 1 if a linting error is reported", () => | ||
assertExitCode(runESLint(["bin/eslint.js", "--env", "es6", "--no-eslintrc", "--rule", "semi: [2, never]"]), 1)); | ||
it("has exit code 1 if a syntax error is thrown", () => | ||
assertExitCode(runESLint(["README.md", "--rulesdir=tools/internal-rules"]), 1)); |
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.
Why did you change these lines?
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.
These test cases rely on ESLint linting itself. I added --rulesdir=tools/internal-rules
to the second test case to ensure that the config file is valid for that run. (This is now necessary because the config file for Makefile.js
involves an internal rule.) The goal is to ensure that the exit code is 1 as a result of the syntax error, not as a result of the missing rule.
it has a conflict. @not-an-aardvark |
1f23051
to
d7f7048
Compare
This makes the following changes: * Creates a project-specific `internal-multiline-comment-style` rule, which is the same as the built-in `multiline-comment-style` rule except that it ignores the banner comments that we use at the top of files. * Enables the `internal-multiline-comment-style` rule on the ESLint codebase * Updates a few tests (namely: `tests/lib/cli-engine.js` and `tests/bin/eslint.js`) that rely on linting the CWD, to account for the fact that the config in the CWD now has a project-specific rule.
d7f7048
to
01224ff
Compare
Fixed the conflict. |
* | ||
* Shorthand for performance. | ||
* | ||
*/ |
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.
is the L49/L51 intentional?
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.
It was created by the autofixer. The original comment also contained blank lines, so I think it's fine that the updated comment has them as well.
* | ||
* Shorthand for performance. | ||
* | ||
*/ |
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.
is the L49/L51 intentional?
//------------------------------------------------------------------------------ | ||
|
||
// The `no-invalid-meta` internal rule has a false positive here. | ||
// eslint-disable-next-line rulesdir/no-invalid-meta |
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.
unrelated: no-invalid-meta seems ideal to be a rule in eslint-plugin-eslint-plugin
, so that other plugin authors can use easily.
What is the purpose of this pull request? (put an "X" next to item)
[x] Other, please explain:
What changes did you make? (Give an overview)
This makes the following changes:
internal-multiline-comment-style
rule, which is the same as the built-inmultiline-comment-style
rule except that it ignores the banner comments that we use at the top of files. This uses eslint-rule-composer to build off of the existing rule, rather than copying it and making changes.internal-multiline-comment-style
rule on the ESLint codebasetests/lib/cli-engine.js
andtests/bin/eslint.js
) that rely on linting the CWD, to account for the fact that the config in the CWD now has a project-specific rule.Is there anything you'd like reviewers to focus on?
Nothing in particular