Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Feature request: ignore-file option for no-import-side-effect #2264

Closed
buu700 opened this issue Feb 28, 2017 · 2 comments
Closed

Feature request: ignore-file option for no-import-side-effect #2264

buu700 opened this issue Feb 28, 2017 · 2 comments

Comments

@buu700
Copy link
Contributor

buu700 commented Feb 28, 2017

Similarly to the current option that takes a regex to match modules that should be allowed to be imported with side effects, it'd be nice if there were an option that would let me do the same thing except for files in my project.

Specifically, I have a main.ts that imports a decent number of external modules for their side effects by design, and it'd be more convenient to configure "no-import-side-effect": [true, {"ignore-file": "main\\.ts"}] than "no-import-side-effect": [true, {"ignore-module": "(angular|angular-material|jquery|zone\\.js|etc.)"]. This would also solve the problem that I don't necessarily want any other files performing side-effect imports of, say, zone.js just because main.ts does it.

@adidahiya
Copy link
Contributor

I'm fairly opposed to adding file names or globs to rule config options. tslint.json should define how to lint, not what to lint. I suggest using comment flags for your use case. Related: #629 (comment)

@buu700
Copy link
Contributor Author

buu700 commented Feb 28, 2017

Cool, makes sense. In that case, is the ignore-module option most likely going to be deprecated at some point?

@buu700 buu700 closed this as completed Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants