-
Notifications
You must be signed in to change notification settings - Fork 67
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
Enable "strict" compiler option #2352
Enable "strict" compiler option #2352
Conversation
🦋 Changeset detectedLatest commit: 4761d53 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 |
@@ -55,7 +61,7 @@ function restrictUserTsconfig( | |||
|
|||
// Where the user has defined allowlist-supported compiler options, apply them | |||
for (const item of COMPILER_OPTIONS_ALLOW_LIST) { | |||
if (compilerOptions && compilerOptions[item]) { | |||
if (compilerOptions?.[item] !== undefined) { |
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.
nit: I get that this is needed to allow false
, but by explicitly checking for !== undefined
I think you might be technically allowing something like null
. Saying that, it's probably OK to consider that something end users should fix though, rather than validating values here or anything.
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.
@sgb-io I guess if we end up with null
there, it means that the user explicitly (and probably erroneously) ended up with a null
option in their configuration. I think we should let tsconfig validate and eventually throw in that case, instead of ignoring the option, because it could be a symptom of something wrong (i.e. buggy conf script / json from the user). undefined
is a special case, because unfortunately it means both "absence of key" and "key was set to undefined" in Javascript, and there's no way of distinguishing that if the conf comes from outside.
strict