Skip to content

script-utils/check-project-types

Type-checks a set of TypeScript files with skipLibCheck disabled, but reports only the diagnostics whose source file we own. This lets the general build run with skipLibCheck: true (so it does not fail on broken upstream .d.ts files we do not control, such as a given version’s obsidian.d.ts) while still fully validating the declarations we author.

When upstream types are fixed, the Ignored N diagnostic(s) count drops to 0, signalling the workaround is no longer doing anything.

InterfaceDescription
CheckProjectTypesParamsParameters for checkProjectTypes.
ParsedTsConfigThe resolved result of parseTsConfig.
FunctionDescription
checkProjectTypesType-checks a set of files with skipLibCheck: false, but reports only the diagnostics whose source file passes shouldKeepFile. Diagnostics from files we do not control (e.g. broken third-party .d.ts pulled in transitively) are dropped, while still being counted for visibility. When isVerbose is set, the dropped diagnostics are also printed in full.
parseTsConfigParses a tsconfig.json (resolving extends, include, exclude) into the resolved file list and compiler options.
toCanonicalNormalizes a file path for comparison: forward slashes everywhere, lower-cased on a case-insensitive file system.