How to use the DiagnosticCategory function from typescript

Find comprehensive JavaScript typescript.DiagnosticCategory code examples handpicked from public code repositorys.

105
106
107
108
109
110
111
112
113
114
    }
    break;
case ts.DiagnosticCategory.Message:
case ts.DiagnosticCategory.Suggestion:
// Warnings?
case ts.DiagnosticCategory.Warning:
    if (compiler_cli_1.isNgDiagnostic(diagnostic)) {
        ngWarnings.push(diagnostic);
    }
    else {
fork icon0
star icon0
watch icon1

+ 4 other calls in file

1
2
3
4
5
6
7
8
9
10
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformJavascript = void 0;
const ts = require("typescript");
function validateDiagnostics(diagnostics, strict) {
    // Print error diagnostics.
    const hasError = diagnostics.some(diag => diag.category === ts.DiagnosticCategory.Error);
    if (hasError) {
        // Throw only if we're in strict mode, otherwise return original content.
        if (strict) {
            const errorMessages = ts.formatDiagnostics(diagnostics, {
fork icon0
star icon0
watch icon1

Other functions in typescript

Sorted by popularity

function icon

typescript.SyntaxKind is the most popular function in typescript (82777 examples)