From 0469abd4a9c9270a1fdc962969e36e63699af8b4 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 10 Dec 2017 21:51:33 +0100 Subject: upgrade dependencies --- node_modules/tslint/lib/rules/noStringLiteralRule.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'node_modules/tslint/lib/rules/noStringLiteralRule.js') diff --git a/node_modules/tslint/lib/rules/noStringLiteralRule.js b/node_modules/tslint/lib/rules/noStringLiteralRule.js index 7774cbcb2..c543aa4d8 100644 --- a/node_modules/tslint/lib/rules/noStringLiteralRule.js +++ b/node_modules/tslint/lib/rules/noStringLiteralRule.js @@ -50,9 +50,11 @@ function walk(ctx) { if (tsutils_1.isElementAccessExpression(node)) { var argument = node.argumentExpression; if (argument !== undefined && tsutils_1.isStringLiteral(argument) && tsutils_1.isValidPropertyAccess(argument.text)) { + // for compatibility with typescript@<2.5.0 to avoid fixing expr['__foo'] to expr.___foo + var propertyName = ts.unescapeIdentifier(argument.text); // tslint:disable-line:deprecation ctx.addFailureAtNode(argument, Rule.FAILURE_STRING, // expr['foo'] -> expr.foo - Lint.Replacement.replaceFromTo(node.expression.end, node.end, "." + argument.text)); + Lint.Replacement.replaceFromTo(node.expression.end, node.end, "." + propertyName)); } } return ts.forEachChild(node, cb); -- cgit v1.2.3