How to use the tokenToString function from typescript

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

120
121
122
123
124
125
126
127
128
129
CurlyWalker.prototype.checkStatement = function (statement, node, childIndex, end) {
    if (end === void 0) { end = statement.end; }
    var sameLine = tsutils_1.isSameLine(this.sourceFile, statement.pos, statement.end);
    if (statement.kind !== ts.SyntaxKind.Block && !(this.options.ignoreSameLine && sameLine)) {
        var token = node.getChildAt(childIndex, this.sourceFile);
        var tokenText = ts.tokenToString(token.kind);
        this.addFailure(token.end - tokenText.length, end, Rule.FAILURE_STRING_FACTORY(tokenText), this.createMissingBraceFix(statement, node, sameLine));
    }
};
/** Generate the necessary replacement to add braces to a statement that needs them. */
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)