rxjs-tslint-rules: Error: Cannot find 'rxjs.imports.ts' in the compiled program. Has it been imported?
I’m getting this error when running the linter:
Error: Cannot find '/path/to/app/src/rxjs.imports.ts' in the compiled program. Has it been imported?
at Walker.findSourceFile (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:136:15)
at Walker.walkFile (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:146:35)
at Walker.onSourceFileEnd (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:48:31)
at Walker.AddedWalker.visitNode (/path/to/app/node_modules/rxjs-tslint-rules/dist/support/added-walker.js:41:18)
at Walker.SyntaxWalker.walk (/path/to/app/node_modules/tslint/lib/language/walker/syntaxWalker.js:24:14)
at Rule.AbstractRule.applyWithWalker (/path/to/app/node_modules/tslint/lib/language/rule/abstractRule.js:31:16)
at Rule.applyWithProgram (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:15:21)
at Linter.applyRule (/path/to/app/node_modules/tslint/lib/linter.js:174:29)
at /path/to/app/node_modules/tslint/lib/linter.js:119:85
at Object.flatMap (/path/to/app/node_modules/tslint/lib/utils.js:151:29)
The linter found the errors though and I could fix the problems, but I’m still getting this. I have added the rxjs-add
ruleset following the instructions in the README file and I’ve imported my rxjs.imports.ts
file in main.ts
, just like in the example code.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (7 by maintainers)
@bjohnson-va You shouldn’t need to remove
tsconfig.e2e.json
. Angular creates that file. It doesn’t - unless things have very recently changed - create a TSLint configuration file in thee2e
directory. You can create that file to disable the RxJS-related rule (using TSLint’s relative-configuration-file mechanism).I would not recommend removing
tsconfig.e2e.json
, even if you are not using end-to-end tests.