UNPKG

fuse-box-typechecker

Version:

Fuse-Box type checker plugin for fusebox 4.0.0 ++

27 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.processTsDiagnostics = void 0; const interfaces_1 = require("./interfaces"); const ts = require("typescript"); function processTsDiagnostics(_options, errors) { return errors.globalErrors .concat(errors.semanticErrors) .concat(errors.syntacticErrors) .concat(errors.optionsErrors) .filter((diag) => diag.file) .map((diag) => { // set color from options const { line, character } = diag.file.getLineAndCharacterOfPosition(diag.start); return { fileName: diag.file.fileName, line: line + 1, message: ts.flattenDiagnosticMessageText(diag.messageText, interfaces_1.END_LINE), char: character + 1, color: 'red', category: `${ts.DiagnosticCategory[diag.category]}:`, code: `TS${diag.code}` }; }); } exports.processTsDiagnostics = processTsDiagnostics; //# sourceMappingURL=processTsDiagnostics.js.map