Nicholas Jamieson
1 min readDec 15, 2017

--

You could configure the no-import-side-effect rule to ignore the side-effect import of the rxjs-imports.ts module, using configuration like this:

"no-import-side-effect": {
"options": {
"ignore-module": "rxjs\\.imports$"
},
"severity": "error"
}

However, that won’t ignore the side-effect imports within that module. To ignore those, you could use a TSLint comment flag at the top of the file:

/*tslint:disable:no-import-side-effect*/

You’d need similar comment flags in polyfills.ts and test.ts, too.

If you were to rely solely on that approach, you would not know about unused RxJS side-effect imports. rxjs-tslint-rules performs static analysis and can be configured to fail if there are unused RxJS imports — that’s the biggest advantage of using the rule extensions.

--

--

Nicholas Jamieson
Nicholas Jamieson

Written by Nicholas Jamieson

RxJS core team member; front-end developer; mentor; speaker; open-source contributor

No responses yet