Skip to content

feat: allow passing parser options to parseAndWalk #110

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 4 commits into from
Jul 18, 2025

Conversation

cernymatej
Copy link
Contributor

The previous regex used for detecting the language from the file extension used the first match. This, however, causes problems when there is a file extension in the name of a directory, for example.

I couldn't figure out how to use $ in magic-regexp, so I replaced it with a normal regex 🙈

This PR also exposes the parser options for more flexibility.

@danielroe
Copy link
Collaborator

oops @Boshen - I didn't spot you were merging at the same time 😆

@danielroe danielroe changed the title fix: detect language based on last extension and expose parser options fix: expose parser options Jul 18, 2025
@danielroe danielroe changed the title fix: expose parser options feat: allow passing parser options to parseAndWalk Jul 18, 2025
@danielroe danielroe requested a review from Boshen July 18, 2025 08:58
@Boshen Boshen merged commit 1e55eb8 into oxc-project:main Jul 18, 2025
2 checks passed
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.

3 participants