MCPcopy Index your code
hub / github.com/angular/angular / visitNode

Function visitNode

tools/tslint/noImplicitOverrideAbstractRule.ts:38–54  ·  view source on GitHub ↗

* For a TypeScript AST node and each of its child nodes, check whether the node is a class * element which implements an abstract member but does not have the `override` keyword.

(node: ts.Node, ctx: WalkContext, program: ts.Program)

Source from the content-addressed store, hash-verified

36 * element which implements an abstract member but does not have the `override` keyword.
37 */
38function visitNode(node: ts.Node, ctx: WalkContext, program: ts.Program) {
39 // If a class element implements an abstract member but does not have the
40 // `override` keyword, create a lint failure.
41 if (
42 ts.isClassElement(node) &&
43 !hasOverrideModifier(node) &&
44 matchesParentAbstractElement(node, program)
45 ) {
46 ctx.addFailureAtNode(
47 node,
48 FAILURE_MESSAGE,
49 Replacement.appendText(node.getStart(), `override `),
50 );
51 }
52
53 ts.forEachChild(node, (n) => visitNode(n, ctx, program));
54}
55
56/**
57 * Checks if the specified class element matches a parent abstract class element. i.e.

Callers 1

applyWithProgramMethod · 0.70

Calls 3

hasOverrideModifierFunction · 0.85
appendTextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…