-
Notifications
You must be signed in to change notification settings - Fork 455
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 tsconfig alias to tsConfig option #1565
Conversation
Pull Request Test Coverage Report for Build 4561
💛 - Coveralls |
* - `false`: do NOT use default config file | ||
* - `path/to/tsconfig.json`: path to a specific tsconfig file (<rootDir> can be used) | ||
* - `{...}`: an object with inline compiler options | ||
* - `false`: do NOT use default config file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/types.ts
Outdated
*/ | ||
packageJson?: boolean | string | object | ||
packageJson?: false | string | object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing boolean
type with false
reminds the user that the default value is true
; thus, it would be redundant to supply true
in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be misleading. A type of false
implies that it will always be false
and not that the default value will be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- An optional property with a union type of
false | string | object
does not at all imply that it will always be false. - The default value is not
true
, butundefined
, according to this line. - This is an option. The default value is
undefined
. You may override that value withfalse | string | object
. A value oftrue
would be superfluous and redundant; thus, misleading. - The proper way to indicate default values is with the
@default
TSDoc tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment above was only in the context of the false
part of the sum type defined. The other two (string/object) are not relevant to this discussion.
Even if a value of true
would be redundant, the fact that it can be set means that the type should be boolean and not false. Even though it's redundant, adding that makes it clear in the user's setup what is happening. If it's true by virtue of being absent, it's not always clear - the user will have to know or will have to read the documentation to understand the behavior.
I agree with 4 and that's also part of the reason I'm in favor of leaving the type as boolean instead of false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not interested in fighting this, so I restored the Booleans.
d7309a9
to
8e5091c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @jedmao
Summary
Fixes #1564
Test plan
Added
tsconfig
scenario to existing relevant test.Does this PR introduce a breaking change?