Skip to content

Enable optional chaining by default in @babel/parser #10810

@nicolo-ribaudo

Description

@nicolo-ribaudo

Feature Request

Optional chaining is Stage 4!

This means that it should be enabled by default in @babel/parser 🎉

It should be done similarly to this commit: 24c4901

  1. Remove all the this.hasPlugin and this.expectPlugin checks related to this plugin in packages/babel-parser/src
  2. Remove all the usages of optionalChaining in @babel/parser's tests
  3. Probably there is a test to ensure that the plugin is required; it can be removed.
  4. Move the tests from the experimental folder to es2020
  5. PR! 🎉

If it is the first time that you contribute to Babel, follow these steps: (you need to have make and yarn available on your machine)

  1. Write a comment there to let other possible contributors know that you are working on this bug.
  2. Fork the repo
  3. Run git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babel
  4. Run yarn && make bootstrap
  5. Wait ⏳
  6. Run make watch (or make build whenever you change a file)
  7. Add a test if needed (only input.js; output.js will be automatically generated)
  8. Update the code!
  9. yarn jest babel-parser to run the tests
    • If some test outputs don't match but the new results are correct, you can delete the bad output.js files and run the tests again
    • If you prefer, you can run OVERWRITE=true yarn jest babel-parser and they will be automatically updated.
  10. If it is working, run make test to run all the tests
  11. Run git push and open a PR!

Metadata

Metadata

Assignees

Labels

Has PRclaimedgood first issueoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions