(sourceFile: ts.SourceFile)
| 4 | /** Lint rule that disallows coercion class members. */ |
| 5 | export 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 | } |
nothing calls this directly
no test coverage detected