From 935f57f8a2066f3f3c241394255a9c7c7e84a205 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Thu, 27 Feb 2020 15:40:00 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Enforce=C2=A0`noImplictAny`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/checks.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/checks.ts b/src/checks.ts index 40ad164b..24a5a300 100644 --- a/src/checks.ts +++ b/src/checks.ts @@ -109,8 +109,16 @@ export async function checkTsconfig(dirPath: string, dt: DefinitelyTypedInfo | u throw new Error('Must specify "lib", usually to `"lib": ["es6"]` or `"lib": ["es6", "dom"]`.'); } + if (!options.strict) { + for (const key of ["noImplicitAny"]) { + if (!options[key]) { + throw new Error(`Expected \`"${key}": true\`.`); + } + } + } + if (!("strict" in options)) { - for (const key of ["noImplicitAny", "noImplicitThis", "strictNullChecks", "strictFunctionTypes"]) { + for (const key of ["noImplicitThis", "strictNullChecks", "strictFunctionTypes"]) { if (!(key in options)) { throw new Error(`Expected \`"${key}": true\` or \`"${key}": false\`.`); }