@fimbul/mimir
Advanced tools
Comparing version 0.11.0 to 0.12.0-dev.20180624
{ | ||
"name": "@fimbul/mimir", | ||
"version": "0.11.0", | ||
"version": "0.12.0-dev.20180624", | ||
"description": "Core rules of the Fimbullinter project", | ||
@@ -28,3 +28,3 @@ "main": "recommended.yaml", | ||
"dependencies": { | ||
"@fimbul/ymir": "^0.11.0", | ||
"@fimbul/ymir": "0.11.0", | ||
"chalk": "^2.3.2", | ||
@@ -31,0 +31,0 @@ "debug": "^3.1.0", |
@@ -33,5 +33,8 @@ "use strict"; | ||
continue; | ||
const parent = node.parent; | ||
const expressionNeedsParens = node.expression.kind === ts.SyntaxKind.BinaryExpression; | ||
const needsParens = tsutils_1.isBinaryExpression(parent) && parent.operatorToken.kind === ts.SyntaxKind.AsteriskAsteriskToken; | ||
context.addFailure(match.index, node.end, "Use the classic type assertion style '<T>obj' instead.", [ | ||
ymir_1.Replacement.append(node.getStart(context.sourceFile), `<${node.type.getText(context.sourceFile)}>`), | ||
ymir_1.Replacement.delete(node.expression.end, node.end), | ||
ymir_1.Replacement.append(node.getStart(context.sourceFile), `${charIf(needsParens, '(')}<${node.type.getText(context.sourceFile)}>${charIf(expressionNeedsParens, '(')}`), | ||
ymir_1.Replacement.replace(node.expression.end, node.end, charIf(expressionNeedsParens, ')') + charIf(needsParens, ')')), | ||
]); | ||
@@ -38,0 +41,0 @@ } |
Sorry, the diff of this file is not supported yet
354399
3791
Updated@fimbul/ymir@0.11.0