MCPcopy Index your code
hub / github.com/angular/components / apply

Method apply

tools/tslint-rules/noCoercionMembersRule.ts:6–27  ·  view source on GitHub ↗
(sourceFile: ts.SourceFile)

Source from the content-addressed store, hash-verified

4/** Lint rule that disallows coercion class members. */
5export class Rule extends Lint.Rules.AbstractRule {
6 apply(sourceFile: ts.SourceFile) {
7 return this.applyWithFunction(
8 sourceFile,
9 (context: Lint.WalkContext<string[]>) => {
10 (function visitNode(node: ts.Node) {
11 if (ts.isClassDeclaration(node)) {
12 node.members.forEach(member => {
13 if (member.name?.getText().startsWith('ngAcceptInputType_')) {
14 context.addFailureAtNode(
15 member,
16 'Coercion members are not allowed. Add the type to the input setter instead.',
17 );
18 }
19 });
20 }
21
22 ts.forEachChild(node, visitNode);
23 })(context.sourceFile);
24 },
25 this.getOptions().ruleArguments,
26 );
27 }
28}

Callers

nothing calls this directly

Calls 2

getTextMethod · 0.45
getOptionsMethod · 0.45

Tested by

no test coverage detected