diff --git a/source/rules/rxjsAddRule.ts b/source/rules/rxjsAddRule.ts index 52fd4a1a..2c1db442 100644 --- a/source/rules/rxjsAddRule.ts +++ b/source/rules/rxjsAddRule.ts @@ -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) => {