-
-
Notifications
You must be signed in to change notification settings - Fork 64
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: add support for jsconfig.json
#161
Conversation
🦋 Changeset detectedLatest commit: 3678a1b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
My mistake - didn't check coverage. Adding another test case now. |
It seems you didn't follow own commit message lint at the same time. See also https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional |
@JounQin thanks, I was having some issues with my editor so it didn't run. Checks are passing now. |
jsconfig.json
@rbong Thanks for your contribution! |
It seems I/we forgot to update README to mention this. 🤣 |
close #73
tl;dr - this handles the case of
project: "path/to/jsconfig.json"
without breakingproject: "/path/to/dir"
.Context:
get-tsconfig
behaviourIf a path other than
tsconfig.json
is used,getTsconfig
requires that the first argument is a directory and the second argument is a path.The second argument to
getTsconfig
must not be a directory, otherwise it will try to read it as a file, resulting in an error.Current behaviour
The given
project
paths, or the resulting paths from globs, are passed as the first and only argument togetTsconfig
.Changes
In the case that the given
project
path is a file, or a glob results in a file, its parent directory will be passed as the first argument togetTsconfig
and its base name will be the second argument.This fixes passing full filenames other than
tsconfig.json
, ex.jsconfig.json
.In the case that a given
project
path is a directory, or a glob results in a directory, the full path will be passed as the first and only argument togetTsconfig
.This distinction is necessary, since if the base name of a directory is passed as the second argument it will result in an error.