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

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

Merged
merged 3 commits into from Oct 24, 2019
Merged

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

merged 3 commits into from Oct 24, 2019

Conversation

@mysticatea
Copy link
Member

mysticatea commented Sep 24, 2019

WIP. Done.

  • acornjs/acorn#870 acorn introduces a new mechanism that plugins access the actually applied acorn entity.
  • acornjs/acorn-jsx#102 acorn-jsx plugin uses the mechanism.
  • eslint/espree#426 espree plugin uses the mechanism.
  • release a new espree.
  • (this PR) eslint uses the updated espree.

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)
package.json Outdated Show resolved Hide resolved
mysticatea added 2 commits Oct 21, 2019
@mysticatea

This comment has been minimized.

Copy link
Member Author

mysticatea commented Oct 21, 2019

This PR is ready for review.

Copy link
Member

kaicataldo left a comment

LGTM, thanks!

@kaicataldo kaicataldo merged commit b3dbd96 into master Oct 24, 2019
17 checks passed
17 checks passed
Verify Files
Details
Test (ubuntu-latest, 8.x)
Details
Test (ubuntu-latest, 10.x)
Details
Test (ubuntu-latest, 12.x)
Details
Test (windows-latest, 12.x)
Details
Test (macOS-latest, 12.x)
Details
Browser Test
Details
commit-message PR title follows commit message guidelines
Details
continuous-integration Build #20191021.3 succeeded
Details
continuous-integration (Test on Node.js 10 (Linux)) Test on Node.js 10 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Linux)) Test on Node.js 12 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Windows)) Test on Node.js 12 (Windows) succeeded
Details
continuous-integration (Test on Node.js 12 (macOS)) Test on Node.js 12 (macOS) succeeded
Details
continuous-integration (Test on Node.js 8 (Linux)) Test on Node.js 8 (Linux) succeeded
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
wip This PR is no longer a work in progress
Details
@kaicataldo kaicataldo deleted the issue11018 branch Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.