Skip to content

Commit

Permalink
refactor(rxjs-add): Skip .d.ts files.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Jul 18, 2017
1 parent 399a022 commit ba18815
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions source/rules/rxjsAddRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,28 @@ class Walker extends UsedWalker {
for (let i = 0, length = sourceFiles.length; i < length; ++i) {

const sourceFile = sourceFiles[i];
const sourceFileWalker = new UsedWalker(sourceFile, {
disabledIntervals: [],
ruleArguments: [],
ruleName: this.getRuleName(),
ruleSeverity: "error"
}, program);
sourceFileWalker.walk(sourceFile);

Object.keys(sourceFileWalker.usedObservables).forEach((key) => {
sourceFileWalker.usedObservables[key].forEach((node) => {
UsedWalker.add(usedObservables, key, node);
if (!sourceFile["isDeclarationFile"]) {

const sourceFileWalker = new UsedWalker(sourceFile, {
disabledIntervals: [],
ruleArguments: [],
ruleName: this.getRuleName(),
ruleSeverity: "error"
}, program);
sourceFileWalker.walk(sourceFile);

Object.keys(sourceFileWalker.usedObservables).forEach((key) => {
sourceFileWalker.usedObservables[key].forEach((node) => {
UsedWalker.add(usedObservables, key, node);
});
});
});

Object.keys(sourceFileWalker.usedOperators).forEach((key) => {
sourceFileWalker.usedOperators[key].forEach((node) => {
UsedWalker.add(usedOperators, key, node);
Object.keys(sourceFileWalker.usedOperators).forEach((key) => {
sourceFileWalker.usedOperators[key].forEach((node) => {
UsedWalker.add(usedOperators, key, node);
});
});
});
}
}

Object.keys(addedObservables).forEach((key) => {
Expand Down

0 comments on commit ba18815

Please sign in to comment.