question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable logical assignment by default in @babel/parser

See original GitHub issue

Feature Request

<div align="center">

Logical Assignment (&&=, ||=, ??=) is Stage 4!

</div>

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

It should be done similarly to this commit: https://github.com/babel/babel/commit/c3388ea42f3ec2d9614503fd0eff81b679ba12a7

  1. Remove all the this.hasPlugin and this.expectPlugin checks related to logicalAssignment in packages/babel-parser/src
  2. Remove all the usages of logicalAssignment 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 es2021, create one if it doesn’t exist
  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 yarn jest to run all the tests
  11. Run git push and open a PR!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JLHwungcommented, Jul 21, 2020

@pustovalov Thanks for showing up. A good first issue targets to first-time contributors. That said, if it is not claimed by a new contributor in the next 24 hours, it will be yours!

0reactions
existentialismcommented, Jul 22, 2020

@vahnag no rush!

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/plugin-syntax-logical-assignment-operators
Instead, use plugin-proposal-logical-assignment-operators to both parse and transform this syntax.
Read more >
@babel/plugin-proposal-logical-assignment-operators | Yarn
Transforms logical assignment operators into short-circuited assignments. babel-plugin. readme. babel. The compiler for writing next generation JavaScript.
Read more >
@babel/plugin-syntax-logical-assignment-operators | npm | Open ...
@babel/plugin-syntax-logical-assignment-operators. check_circle. 7.10.4. Default version ... Description. Allow parsing of the logical assignment operators ...
Read more >
babel/eslint-parser - NPM Package Versions - Socket.dev
Start using Socket to analyze @babel/eslint-parser and its 3 dependencies to secure your app from ... babel-plugin-proposal-logical-assignment-operators ...
Read more >
@babel/runtime: Versions | Openbase
#14695 [parser] Make decoratorsBeforeExport default to false (@nicolo-ribaudo) ... #11876 enable logical assignment in babel preset env (@morrme) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found