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

New: multiple processors support (fixes #11035, fixes #11725) #11552

Merged
merged 16 commits into from May 25, 2019

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Mar 26, 2019

What is the purpose of this pull request? (put an "X" next to item)

[X] Add something to the core: fixes #11035, fixes #11725

What changes did you make? (Give an overview)

This PR adds support for multiple processors (eslint/rfcs#3).

  • The preprocess method of processors now can return { text, filename } formed objects.
  • The processor key in config files.
  • The disableFixs option in Linter#verify() method to disable autofix for the processors which don't support autofix in recursive calls.
  • The filterCodeBlock option in Linter#verify() method to filter code blocks by --ext option in recursive calls.

This implementation is different a bit from what eslint/rfcs#3 described because #11546 improved the configuration calculation. The current configuration calculation doesn't need file systems, so we don't need to move the application of processors to CLIEngine. It avoided cloning Linter#verifyAndFix logic to CLIEngine.

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

Nothing in particular.

@mysticatea mysticatea added core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion feature This change adds a new feature to ESLint labels Mar 26, 2019
@mysticatea mysticatea added the do not merge This pull request should not be merged yet label Mar 26, 2019
@mysticatea mysticatea removed the do not merge This pull request should not be merged yet label May 10, 2019
@mysticatea
Copy link
Member Author

I updated this PR and I believe ready for review.

@mysticatea
Copy link
Member Author

I'm sorry, I updated this PR because I found Linter#verify() didn't support the new returned value type of preprocess method.

I believe ready for review, again.

@aladdin-add aladdin-add self-requested a review May 15, 2019 16:05
@mysticatea mysticatea added this to Implemented, pending review in v6.0.0 May 16, 2019
@mysticatea mysticatea removed this from Implemented, pending review in v6.0.0 May 16, 2019
@mysticatea
Copy link
Member Author

I have added some additional tests because the coverage check failed after I merged master into this branch. Some tests are not related to this feature, but it improves coverage.

@mysticatea mysticatea changed the title New: multiple processors support (fixes #11035) New: multiple processors support (fixes #11035, fixes #11725) May 22, 2019
docs/developer-guide/nodejs-api.md Outdated Show resolved Hide resolved
docs/developer-guide/nodejs-api.md Outdated Show resolved Hide resolved
docs/developer-guide/working-with-plugins.md Outdated Show resolved Hide resolved
docs/developer-guide/working-with-plugins.md Outdated Show resolved Hide resolved
docs/user-guide/configuring.md Outdated Show resolved Hide resolved
lib/linter/linter.js Show resolved Hide resolved
docs/developer-guide/nodejs-api.md Outdated Show resolved Hide resolved
lib/linter/linter.js Show resolved Hide resolved
mysticatea and others added 2 commits May 24, 2019 13:39
Co-Authored-By: Ilya Volodin <ivolodin@gmail.com>
Co-Authored-By: Ilya Volodin <ivolodin@gmail.com>
mysticatea and others added 4 commits May 24, 2019 13:41
@mysticatea
Copy link
Member Author

Thank you for your review! I updated this PR.

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.

LGTM in general, just some minor suggestions for readability. Thanks!

lib/cli-engine/file-enumerator.js Outdated Show resolved Hide resolved
lib/shared/config-validator.js Outdated Show resolved Hide resolved
tests/lib/cli-engine/cli-engine.js Outdated Show resolved Hide resolved
@mysticatea
Copy link
Member Author

Thank you for your review! I updated this PR.

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.

LGTM, thanks!

@ilyavolodin ilyavolodin merged commit b5fa149 into master May 25, 2019
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Oct 31, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps. and devDeps; istanbul -> nyc

Update object-assign, unified, remark-parse for deps and eslint-release, chai, mocha, eslint for devDeps.
In process of updating:

1. Get plugins tests to work with eslint 6
2. In whitespace processor test, add an extra line break for the expected since `remark-parse@7` started preserving them (see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps. and devDeps; istanbul -> nyc

Update object-assign, unified, remark-parse for deps and eslint-release, chai, mocha, eslint for devDeps.
In process of updating:

1. Get plugins tests to work with eslint 6
2. In whitespace processor test, add an extra line break for the expected since `remark-parse@7` started preserving them (see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps. and devDeps; istanbul -> nyc

Update object-assign, unified, remark-parse for deps and eslint-release, chai, mocha, eslint for devDeps.
In process of updating:

1. Get plugins tests to work with eslint 6
2. In whitespace processor test, add an extra line break for the expected since `remark-parse@7` started preserving them (see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update object-assign, unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update object-assign, unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update object-assign, unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update object-assign, unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 1, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 2, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
brettz9 added a commit to brettz9/eslint-plugin-markdown that referenced this pull request Nov 3, 2019
…ps://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements / eslint/eslint#11552

Upgrade: Update deps.

Update unified, remark-parse for deps. In process of updating,
for whitespace processor test, add an extra line break
for the expected since `remark-parse@7` started preserving them
(see remarkjs/remark#351 )
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Nov 22, 2019
@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 Nov 22, 2019
@mysticatea mysticatea deleted the processor-improvements branch April 14, 2020 09:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESLint 6.0.0-alpha.1 no longer passes the filename to processors Better support for multiple processors
4 participants