Skip to content

Fix: problematic installation issue (fixes #11018)#12309

Merged
kaicataldo merged 3 commits intomasterfrom
issue11018
Oct 24, 2019
Merged

Fix: problematic installation issue (fixes #11018)#12309
kaicataldo merged 3 commits intomasterfrom
issue11018

Conversation

@mysticatea
Copy link
Copy Markdown
Member

@mysticatea mysticatea commented Sep 24, 2019

WIP. Done.


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

[X] Bug fix: #11018

What changes did you make? (Give an overview)

This PR fixes #11018 as using the new mechanism that acorn plugins can access the actually applied acorn entity.

The problem has happened when the two acorns are different entities.

  1. The acorn that is using plugins.
  2. The acorn that the plugins imported by require("acorn").

After this PR, acorn plugins get to not use require("acorn").

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

I'm not sure how I add tests.

You can confirm that this PR fixes the problem:

  1. Install eslint, espree@6.1.1 and acorn@6 (espree@6.1.2 has been fixed this problem)
    npm install acorn@6.x espree@6.1.1 eslint
    
  2. Check node_modules has the following structure.
    node_modules/
    ├ acorn/ (6.x)
    ├ acorn-jsx/
    └ espree/ (6.1.1)
      └ node_modules/
        └ acorn/ (7.x)
    
  3. Lint a file that contains JSX syntax. (expected a syntax error of the problem)
  4. Install the latest espree.
    npm install espree@latest
    
  5. Lint a file that contains JSX syntax. (expected no errors)

@mysticatea mysticatea added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion do not merge This pull request should not be merged yet labels Sep 24, 2019
Comment thread package.json Outdated
@mysticatea mysticatea removed the do not merge This pull request should not be merged yet label Oct 21, 2019
@mysticatea
Copy link
Copy Markdown
Member Author

This PR is ready for review.

Copy link
Copy Markdown
Member

@kaicataldo kaicataldo 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!

@kaicataldo kaicataldo merged commit b3dbd96 into master Oct 24, 2019
@kaicataldo kaicataldo deleted the issue11018 branch October 24, 2019 19:48
@eslint-deprecated eslint-deprecated Bot locked and limited conversation to collaborators Apr 23, 2020
@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 23, 2020
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 bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSX linting fails due to espree minor release including major dependency bump

4 participants