-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule proposal: Forbid imports with explicit side-effects #529
Comments
What if the rule instead enforced that modules not have side effects? (or only side effects?) The |
I could see the value for both, but I agree that a |
I'd like to work on this soon-ish, especially as it's pretty easy to implement. I still don't see how you can enforce having modules not create side-effects. That'd be awesome if it was possible though... |
Works for me. Name is still not obvious, but that doesn't need to hamper development of the rule, obviously. I thought I had said this in this issue before, but |
Sure, but that does not really prevent them from having side-effects too. |
Yeah, fair enough. I think your original proposal makes the most sense, at least right now. |
IMO, modules that have side-effect just from requiring them are really bad. I would like to see a rule that forbids importing/requiring modules that are not assigned, which implicitly means there is a side-effect or simply not used and therefore useless.
Invalid
Valid
As far as rule name goes:
no-unnassigned-import
,no-side-effect-import
, ...? I'm leaning toward the former at the moment, though it doesn't capture the rationale of it.The text was updated successfully, but these errors were encountered: