Created
August 27, 2018 21:37
-
-
Save phenomnomnominal/0057ea707b12e5d0a857c6522c3957f6 to your computer and use it in GitHub Desktop.
Example of the Rule API from TSLint, using a Walker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies: | |
import { RuleFailure, Rules } from 'tslint'; | |
import { SourceFile } from 'typescript'; | |
export class Rule extends Rules.AbstractRule { | |
public apply (sourceFile: SourceFile): Array<RuleFailure> { | |
return this.applyWithWalker(new MyCustomRuleWalker(sourceFile)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment