Skip to content
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

Merged
merged 1 commit into from Oct 29, 2017

Conversation

not-an-aardvark
Copy link
Member

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:

  • 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. This uses eslint-rule-composer to build off of the existing rule, rather than copying it and making changes.
  • 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.

Is there anything you'd like reviewers to focus on?

Nothing in particular

@not-an-aardvark not-an-aardvark added the chore This change is not user-facing label Oct 16, 2017
@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a 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!

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));
Copy link
Member

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?

Copy link
Member Author

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.

@aladdin-add
Copy link
Member

it has a conflict. @not-an-aardvark

@not-an-aardvark not-an-aardvark changed the title Chore: enable a modified version of multiline-comment-style on codebase Chore: enable modified version of multiline-comment-style on codebase Oct 25, 2017
@not-an-aardvark not-an-aardvark changed the title Chore: enable modified version of multiline-comment-style on codebase Chore: enable a modified version of the multiline-comment-style rule on codebase Oct 25, 2017
@not-an-aardvark not-an-aardvark changed the title Chore: enable a modified version of the multiline-comment-style rule on codebase Chore: modified version of multiline-comment-style rule on codebase Oct 25, 2017
@not-an-aardvark not-an-aardvark changed the title Chore: modified version of multiline-comment-style rule on codebase Chore: enable a modified version of multiline-comment-style rule on codebase Oct 29, 2017
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.
@not-an-aardvark
Copy link
Member Author

Fixed the conflict.

*
* Shorthand for performance.
*
*/
Copy link
Member

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?

Copy link
Member Author

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.
*
*/
Copy link
Member

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
Copy link
Member

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.

@not-an-aardvark not-an-aardvark merged commit 8e1a095 into master Oct 29, 2017
@not-an-aardvark not-an-aardvark deleted the enable-multiline-comment-style branch October 29, 2017 05:30
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 28, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants