Skip to content

Add ECMAScript version to Falafel/Acorn.js config #7501

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

Merged
merged 1 commit into from
Jul 29, 2025

Conversation

camdecoster
Copy link
Contributor

@camdecoster camdecoster commented Jul 29, 2025

Description

Add config option to Falafel calls (which gets passed to Acorn) to allow for parsing of the newest ECMAScript syntax.

Changes

  • Updates (or adds) Falafel config to specify the latest ECMAScript version

Testing

If CI passes, that should be proof enough that this change didn't break anything.

Notes

  • We recently specified an updated version of Acorn.js to be used as a dependency of the Falafel library
  • The newer version of Acorn.js includes a warning message that specifying ecmaVersion is now required:

    Since Acorn 8.0.0, options.ecmaVersion is required. Defaulting to 2020, but this will stop working in the future.

  • Modern ECMAScript syntax can sometimes cause Acorn.js to fail because it's not parsing the proper version of ECMAScript (I saw it with the logical OR operator: ||=)
  • By using an ecmaScript value of "latest" with Acorn.js, we should be covered now and in the future if we start using other modern syntax

@camdecoster camdecoster changed the title Add ECMA version to Falafel/Acorn.js config Add ECMAScript version to Falafel/Acorn.js config Jul 29, 2025
@camdecoster camdecoster merged commit 795da7e into master Jul 29, 2025
6 checks passed
@camdecoster camdecoster deleted the cam/specify-acorn-ecmaVersion branch July 29, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants