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

How to add optionalChaining #1389

Open
andrewdelprete opened this issue Sep 16, 2021 · 3 comments
Open

How to add optionalChaining #1389

andrewdelprete opened this issue Sep 16, 2021 · 3 comments

Comments

@andrewdelprete
Copy link
Contributor

What would be the best way to have documentationjs support optionalChaining again? It looks like it was removed in #1371. I recently upgraded documentation from 13.1.0 to 13.2.5 and some of my code no longer builds because I was using this syntax. Any thoughts? Thank you! 🙇

@anthony-redFox
Copy link
Member

Hello make sure that you use last version of Babel, because it is released as default is on out of the box

@papakillo
Copy link

What would be the best way to have documentationjs support optionalChaining again? It looks like it was removed in #1371. I recently upgraded documentation from 13.1.0 to 13.2.5 and some of my code no longer builds because I was using this syntax. Any thoughts? Thank you! 🙇

@papakillo
Copy link

Use a Custom Babel Configuration
Since documentation.js relies on Babel for parsing, you can provide your own Babel configuration that includes the necessary plugins for supporting optional chaining.

To do this, create a .babelrc file or update your existing Babel configuration to include the necessary plugin:
{ "presets": ["@babel/preset-env"], "plugins": ["@babel/plugin-proposal-optional-chaining"] }
Run documentation build --babel .babelrc -f html -o docs

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

No branches or pull requests

3 participants