Advertisement
Guest User

Untitled

a guest
May 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import * as Lint from 'tslint';
  2. import * as ts from 'typescript';
  3.  
  4. // Exported class always should be named "Rule" and extends Lint.Rules.AbstractRule
  5. export class Rule extends Lint.Rules.AbstractRule {
  6. public static FAILURE_STRING = 'Wrong import order';
  7.  
  8. public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
  9. return this.applyWithWalker(new Walker(sourceFile, 'module-imports-order', this.getOptions()))
  10. }
  11. }
  12.  
  13. class Walker extends Lint.AbstractWalker<any> {
  14. public walk(sourceFile: ts.SourceFile) {
  15. // Some code that will implement your rule logic
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement