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

feat: replace JSON.parse with typescript builtin config parser #63

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

vivedo
Copy link
Contributor

@vivedo vivedo commented Jul 13, 2024

As mentioned in issue #42, borp currently encounters errors when parsing tsconfig.json with comments (and more non standard JSON syntax) because it uses JSON.parse and does not support features available in tsc, such as the ability to extend other configuration files.

typescript provides a few functions to access its internal configuration parser, which can handle all of these cases and provide borp with the exact same configuration as tsc will have

@vivedo vivedo changed the title feat: replace JSON.parse with typescript parseJsonConfigFileContent feat: replace JSON.parse with typescript builtin config parser Jul 13, 2024
Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, but borp doesn't depend on typescript directly. You should load that dynamically.

@vivedo
Copy link
Contributor Author

vivedo commented Jul 13, 2024

Absolutely, should be good to go now!

Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 494cf85 into mcollina:main Jul 15, 2024
5 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.

None yet

2 participants