Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
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

Enable nullish coalescing by default in @babel/parser #10813

Closed
nicolo-ribaudo opened this issue Dec 4, 2019 · 2 comments · Fixed by #10819
Closed

Enable nullish coalescing by default in @babel/parser #10813

nicolo-ribaudo opened this issue Dec 4, 2019 · 2 comments · Fixed by #10819

Comments

@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Dec 4, 2019

Feature Request

Nullish coalescing 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 nullishCoalescingOperator 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!
@layershifter

This comment has been minimized.

Copy link
Contributor

@layershifter layershifter commented Dec 4, 2019

Can I take this one? 😇

@kaicataldo

This comment has been minimized.

Copy link
Member

@kaicataldo kaicataldo commented Dec 4, 2019

@layershifter Have at it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.