-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow up to 10 imports/dependencies #20
Conversation
🤔 I’m not sure about this one. Do you have a concrete example where the amount of type imports does NOT have a negative impact on the readability of the module and thus on the complexity of the business object? Maybe 8 is too restrictive when working with typescript, but I think allowing unlimited amount of type imports is bad for readability and complexity. It would be nice if we could configure two separate limits, one for regular imports and one for type-imports. |
Right now I'm preparing a pull request for pr-log where I need one import more in cli.ts. Right now it has 3 runtime imports and 5 type imports. Unfortunately import/max-dependencies is not able to differentiate between runtime and type-only imports 😕 My wish would be to set two dedicated limits for both.
Yes. But which magic number should we set then? 10? 12?
💯 as I also wrote above. |
I don’t think it should be an arbitrary magical number. Ideally we could rely on neuroscience. How many import statements can be easily read and keep in the current cognitive context while reading the code of the remaining file? Regarding the |
a4a52cd
to
cf94dee
Compare
I don't know. Personally I look never at imports and immediately jump to the very first lines of the implementation.
I changed it to 10 now.
Then maybe we should work on that after my changes regarding |
Should not be count as a dependency in my opinion. Often I need a lot of types in one module, especially when working with dependency injection, but not as many "real" runtime imports. Therefore there should be no limit in allowing type-only imports.