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

Upgrade: esquery@1.2.0 #13076

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Upgrade: esquery@1.2.0 #13076

merged 1 commit into from
Mar 24, 2020

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

  • I have read the contributing guidelines.
  • The team has reached consensus on the changes proposed in this pull request. If not, I understand that the evaluation process will begin with this pull request and won't be merged until the team has reached consensus.

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

[X] Other, please explain:

Upgrade esquery to 1.2.0

What changes did you make? (Give an overview)

Upgraded esquery to 1.2.0 and fixed some problems.

This version has been released today and is causing ESLint builds to fail, for two reasons:

  1. Errors thrown by esquery.parse do not have offset property anymore, I think this was a change in pegjs.

Some tests were (correctly) failing because of this. It's fixed by using err.location.start.offset.

  1. esquery now distributes ESM modules, too.

Webpack by default looks for "module" (ESM) first. Unfortunately, that module is using export default, which turns require("esquery") into something like:

{ default: { parse, match, matches, query } }

instead of expected:

{ parse, match, matches, query }

This produces an invalid build/eslint.js bundle.

Might be relevant issue: webpack/webpack#4742

It's fixed by configuring webpack to always look for "main" first.

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

The size of build/eslint.js increased by only ~1KB.

@mdjermanovic mdjermanovic added the chore This change is not user-facing label Mar 23, 2020
@kaicataldo kaicataldo added the upgrade This change is related to a dependency upgrade label Mar 23, 2020
@nzakas nzakas merged commit 2111c52 into master Mar 24, 2020
@nzakas nzakas deleted the esquery-1.2.0 branch March 24, 2020 00:16
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 22, 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 Sep 22, 2020
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 upgrade This change is related to a dependency upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants