зеркало из https://github.com/microsoft/dtslint.git
Update tuple rule for new AST
This commit is contained in:
Родитель
452bb3ca5a
Коммит
034d77ef6f
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -21,7 +21,7 @@ export class Rule extends Lint.Rules.AbstractRule {
|
|||
function walk(ctx: Lint.WalkContext<void>): 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[]."));
|
||||
|
|
Загрузка…
Ссылка в новой задаче