Lint redundant onTaskType activation events (#173205)

This commit is contained in:
Joyce Er 2023-02-02 14:31:13 -08:00 committed by GitHub
parent 824b66f928
commit ddd71a222d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -504,5 +504,14 @@ function parseImplicitActivationEvents(tree: JsonNode): Set<string> {
}
});
// tasks
const tasks = findNodeAtLocation(tree, ['contributes', 'taskDefinitions']);
tasks?.children?.forEach(child => {
const id = findNodeAtLocation(child, ['type']);
if (id && id.type === 'string') {
activationEvents.add(`onTaskType:${id.value}`);
}
});
return activationEvents;
}