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

Add support for tsconfig extends #37

Merged
merged 4 commits into from
Nov 25, 2021

Conversation

IanVS
Copy link
Contributor

@IanVS IanVS commented Nov 25, 2021

This uses the native typescript utilities for reading and parsing a config file, which means that comments and trailing commas are supported, as well as extending from another config.

I needed to break out a helper function to log messages, since the parsing is slightly different between package.json and config files now, but they can share the same error handling, I think.

I also created a few basic tests for loading config files with comments and commas, as well as extending from other configs. Let me know if you'd like to see more.

Closes #28
Closes #30

@davestewart
Copy link
Owner

Looks good!

It's late here so I'll take a look tomorrow.

Thanks :)

Copy link
Owner

@davestewart davestewart left a comment

Choose a reason for hiding this comment

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

All good! Just some code style changes, thanks :)

PS. Cool that TS does some of the path wrangling. Was going to suggest using the lighter-weight JSON5 but I guess this is a good use case overall.

src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
tests/specs/load.spec.js Outdated Show resolved Hide resolved
@davestewart
Copy link
Owner

OK, linting now added so you'll want to merge and run npm run lint.

@IanVS
Copy link
Contributor Author

IanVS commented Nov 25, 2021

Updated to address linting issues

@davestewart
Copy link
Owner

davestewart commented Nov 25, 2021

No idea what these errors are about. Any ideas?

EDIT: seems to be a build pipeline permissions thing.

I ran the checks locally and it's all good, so going to merge 👍

@davestewart davestewart changed the title Use typescript to parse tsconfig.json Add support for tsconfig extends Nov 25, 2021
@davestewart davestewart merged commit 1930920 into davestewart:master Nov 25, 2021
@IanVS IanVS deleted the parse-tsconfig branch November 29, 2021 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants