Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
feat: Disallow "strict": false
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Mar 2, 2020
1 parent 3c83f95 commit 0984e01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export async function checkTsconfig(dirPath: string, dt: DefinitelyTypedInfo | u
case "lib":
case "noImplicitAny":
case "noImplicitThis":
case "strict":
case "strictNullChecks":
case "strictFunctionTypes":
case "esModuleInterop":
Expand Down Expand Up @@ -109,7 +110,11 @@ export async function checkTsconfig(dirPath: string, dt: DefinitelyTypedInfo | u
throw new Error('Must specify "lib", usually to `"lib": ["es6"]` or `"lib": ["es6", "dom"]`.');
}

if (!("strict" in options)) {
if ("strict" in options) {
if (options.strict !== true) {
throw new Error('When "strict" is present, it must be set to true.');
}
} else {
for (const key of ["noImplicitAny", "noImplicitThis", "strictNullChecks", "strictFunctionTypes"]) {
if (!(key in options)) {
throw new Error(`Expected \`"${key}": true\` or \`"${key}": false\`.`);
Expand Down

0 comments on commit 0984e01

Please sign in to comment.