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

feat: Enforce noImplictAny #275

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
ExE-Boss marked this conversation as resolved.
Show resolved Hide resolved
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\`.`);
}
Expand Down