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

eslint-parser: ES2020 features #11815

Merged
merged 8 commits into from Jul 29, 2020
Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jul 9, 2020

Q                       A
Fixed Issues? Fixes #11711
Minor: New Feature? Yes
Tests Added + Pass? Yes
Any Dependency Changes? eslint-visitor-keys is bumped to ^1.3.0 which includes the ChainExpression visitor keys.
License MIT

This PR adds estree parsing support on the following features:

  • optional chaining expression.
  • nullish coalescing
  • export * ns (credits to @existentialism)

The nullish coalescing is out of the box since ESTree and Babel shares the AST shape. Thus I have enabled test.

The @babel/parser estree plugin now supports parsing optional chaining and export * ns.

@JLHwung JLHwung added PR: New Feature 🚀 A type of pull request used for our changelog categories area: eslint labels Jul 9, 2020
@JLHwung JLHwung requested a review from kaicataldo July 9, 2020 21:06
@babel-bot
Copy link
Collaborator

babel-bot commented Jul 9, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/25849/

@JLHwung JLHwung requested a review from jridgewell July 9, 2020 21:11
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 9, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1d0f3d3:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some fixtures tests for ChainExpression in @babel/parser?

eslint/babel-eslint-parser/src/convert/convertAST.js Outdated Show resolved Hide resolved
@kaicataldo
Copy link
Member

I don’t think this needs to block this PR, but we should make sure we bump the ESLint peer dep version once optional chaining lands in ESLint core (hopefully the next release).

I also have a PR open to upgrade to ESLint v7, so if we can land that it should be an easy bump :)

@kaicataldo
Copy link
Member

ESLint optional chaining PR here.

@existentialism existentialism added this to the 7.11.0 milestone Jul 10, 2020
@existentialism existentialism added the PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release label Jul 14, 2020
@JLHwung JLHwung merged commit d7347fb into babel:main Jul 29, 2020
@JLHwung JLHwung deleted the babel-eslint-es2020 branch July 29, 2020 20:46
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: eslint outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@babel/parser: update ESTree plugin to support optional chaining
5 participants