Skip to content

Commit

Permalink
fix(added-walker): Ignore unknowns.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Oct 7, 2017
1 parent babec0a commit 2489a13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/support/added-walker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import * as Lint from "tslint";
import * as ts from "typescript";
import { knownObservables, knownOperators } from "./knowns";

export class AddedWalker extends Lint.ProgramAwareRuleWalker {

Expand Down Expand Up @@ -33,11 +34,11 @@ export class AddedWalker extends Lint.ProgramAwareRuleWalker {
const moduleSpecifier = node.moduleSpecifier.getText();

let match = moduleSpecifier.match(/["']rxjs\/add\/observable\/(\w+)["']/);
if (match) {
if (match && knownObservables[match[1]]) {
AddedWalker.add(this.addedObservables, match[1], node);
} else {
match = moduleSpecifier.match(/["']rxjs\/add\/operator\/(\w+)["']/);
if (match) {
if (match && knownOperators[match[1]]) {
AddedWalker.add(this.addedOperators, match[1], node);
}
}
Expand Down

0 comments on commit 2489a13

Please sign in to comment.