diff --git a/package.json b/package.json index 3297788667c..1f943f89788 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "ts-node": "latest", "tsd": "latest", "tslint": "next", - "typescript": "2.1.0-dev.20160906" + "typescript": "next" }, "scripts": { "pretest": "jake tests", diff --git a/scripts/tslint/preferConstRule.ts b/scripts/tslint/preferConstRule.ts index 1d316692468..bc484728420 100644 --- a/scripts/tslint/preferConstRule.ts +++ b/scripts/tslint/preferConstRule.ts @@ -21,32 +21,12 @@ function walkUpBindingElementsAndPatterns(node: ts.Node): ts.Node { return node; } -function getCombinedNodeFlags(node: ts.Node): ts.NodeFlags { - node = walkUpBindingElementsAndPatterns(node); - - let flags = node.flags; - if (node.kind === ts.SyntaxKind.VariableDeclaration) { - node = node.parent; - } - - if (node && node.kind === ts.SyntaxKind.VariableDeclarationList) { - flags |= node.flags; - node = node.parent; - } - - if (node && node.kind === ts.SyntaxKind.VariableStatement) { - flags |= node.flags; - } - - return flags; -} - function isLet(node: ts.Node) { - return !!(getCombinedNodeFlags(node) & ts.NodeFlags.Let); + return !!(ts.getCombinedNodeFlags(node) & ts.NodeFlags.Let); } function isExported(node: ts.Node) { - return !!(getCombinedNodeFlags(node) & ts.NodeFlags.Export); + return !!(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export); } function isAssignmentOperator(token: ts.SyntaxKind): boolean {