diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index ca79fc9..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "attach", - "name": "Attach", - "port": 9229, - "sourceMaps": true - }, - { - "type": "node", - "request": "launch", - "name": "Launch Program", - "program": "${workspaceRoot}/test/test.js", - "outFiles": ["${workspaceRoot}/bin"] - } - ] -} \ No newline at end of file diff --git a/src/rules/noSingleElementTupleTypeRule.ts b/src/rules/noSingleElementTupleTypeRule.ts index f627c8d..4c591e3 100644 --- a/src/rules/noSingleElementTupleTypeRule.ts +++ b/src/rules/noSingleElementTupleTypeRule.ts @@ -21,7 +21,7 @@ export class Rule extends Lint.Rules.AbstractRule { function walk(ctx: Lint.WalkContext): void { const { sourceFile } = ctx; sourceFile.forEachChild(function cb(node) { - if (ts.isTupleTypeNode(node) && node.elementTypes.length === 1) { + if (ts.isTupleTypeNode(node) && (node.elements ?? (node as any).elementTypes).length === 1) { ctx.addFailureAtNode(node, failure( Rule.metadata.ruleName, "Type [T] is a single-element tuple type. You probably meant T[]."));