UNPKG

loose-ts-check

Version:

Run TS type-check and ignore certain errors in some files

22 lines (21 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportIgnoredErrorsThatDidNotOccur = void 0; const chalk_1 = require("chalk"); const reportIgnoredErrorsThatDidNotOccur = ({ cliOptions, log }, tscErrors, ignoredErrorCodes) => { const presentTscErrorCodes = new Set(tscErrors.map((tscError) => tscError.tscErrorCode)); const tscErrorCodesThatDidNotOccur = Array.from(ignoredErrorCodes).filter((tscErrorCode) => !presentTscErrorCodes.has(tscErrorCode)); if (tscErrorCodesThatDidNotOccur.length === 0) { return; } log(`${(0, chalk_1.yellow)(tscErrorCodesThatDidNotOccur.length)} currently ignored error codes did not occur`); if (!cliOptions['auto-update']) { log(`Use the ${(0, chalk_1.green)('--auto-update')} option to update the registry automatically.`); return; } tscErrorCodesThatDidNotOccur.forEach((tscErrorCode) => { ignoredErrorCodes.delete(tscErrorCode); }); log('Registry will be updated'); }; exports.reportIgnoredErrorsThatDidNotOccur = reportIgnoredErrorsThatDidNotOccur;