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

Update: support bigint and dynamic import (refs #11803) #11983

Merged
merged 13 commits into from Aug 18, 2019

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Jul 14, 2019

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

[X] Add something to the core (#11803).

What changes did you make? (Give an overview)

This PR adds supports of bigint and dynamic import.

  • Upgrade espree and eslint-visitor-keys.
  • Fix CodePathAnalyzer to handle ImportExpression node as throwable.
  • Fix new-cap rule's false positive.
  • Fix astUtils.getPrecedence function to fix no-extra-paren false positive.
  • Fix astUtils.isNullLiteral function to fix eqeqeq false positive.
  • Update func-call-spacing rule to recognize ImportExpression node.
  • Update function-paren-newline rule to recognize ImportExpression node.
  • Update indent rule to recognize ImportExpression node.
  • Update no-extra-parens rule to recognize ImportExpression node.
  • Add env.es2020 to declare new global variables: BigInt, BigInt64Array, and BigUint64Array.
  • In passing, add env.es2017 to declare new global variables: Atomics and SharedBufferArray. I'm not sure why we have not had it.

(platinumazure: Consumed espree/eslint-visitor-keys, fixed merge conflicts, did some minor chores to get tests to pass-- see commit list.)

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

There are a ton of remaining stuff (see #11803), but those are "enhancements which increase errors." As following our semver policy, we need a major update to add those... :(

Or maybe can we add those with a minor?

@mysticatea mysticatea added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules 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 Jul 14, 2019
@mysticatea
Copy link
Member Author

There are a ton of remaining stuff (see #11803), but those are "enhancements which increase errors." > As following our semver policy, we need a major update to add those... :(

Or maybe can we add those with a minor?

We can update ImportExpression-related change safely because nobody has used ImportExpression node at all. (previously, it had been represented with CallExpression node with Import node in experimental. babel-eslint and @typescript-eslint/parser are using the old form.

@mercmobily
Copy link

What's the status of this PR? #11803 depends on it.

@mysticatea
Copy link
Member Author

Please track #11803. This PR is waiting on new acorn release and the updates of espree and eslint-visitor-keys.

@mdjermanovic
Copy link
Member

A small fix for dot-notation in PR #12095.

astUtils.getStaticPropertyName should be also aware of the Literal.bigint property, there is a pending PR #12056 which fixes the same for regex, feel free to copy everything to this PR if that would be more convenient for the project.

There might be an issue with no-implicit-coercion which auto-fixes +foo to Number(foo) as these two are no longer equivalent (+ throws if foo is a bigint).

This avoids a dependency deduplication conflict for developers
Copy link
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 @mysticatea and @platinumazure for working on this!

@platinumazure platinumazure removed the do not merge This pull request should not be merged yet label Aug 18, 2019
@kaicataldo kaicataldo merged commit fee6acb into master Aug 18, 2019
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 enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants