Skip to content

Commit f888c88

Browse files
authored
Cast identifier names to string in lint rule (#17027)
To be compatible with both the current version of the compiler and the nightly (which uses a branded string for the text member).
1 parent e4a6917 commit f888c88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/tslint/booleanTriviaRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
2727
/** Skip certain function/method names whose parameter names are not informative. */
2828
function shouldIgnoreCalledExpression(expression: ts.Expression): boolean {
2929
if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) {
30-
const methodName = (expression as ts.PropertyAccessExpression).name.text;
30+
const methodName = (expression as ts.PropertyAccessExpression).name.text as string;
3131
if (methodName.indexOf("set") === 0) {
3232
return true;
3333
}
@@ -44,7 +44,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
4444
}
4545
}
4646
else if (expression.kind === ts.SyntaxKind.Identifier) {
47-
const functionName = (expression as ts.Identifier).text;
47+
const functionName = (expression as ts.Identifier).text as string;
4848
if (functionName.indexOf("set") === 0) {
4949
return true;
5050
}

0 commit comments

Comments
 (0)