-
Notifications
You must be signed in to change notification settings - Fork 1
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
Is there a way to disable this rule for a specific import we want to keep at the top of the file? #24
Comments
Sorry for the lack of activity, I did not see the issue You can either mention that import as a new import group in the rule configuration, or use the If you have problems disabling the rule, please provide a concrete example so I can help |
I had something not working, I'll send an example soon. |
@pvinis Did you manage to come up with an example? |
Ah sorry for the delay. Here it is: We import
In the file where we import the file directly, we want it to be the first import because it's importing some shims. In the second import where we have the It would be nice to be able to import like Right now, as a weird workaround, I have that specific file as a separate group and always first, so even in files that import the Does that help/make sense? |
Unfortunately, there is no option to do that at the moment. However, it seems that you want the shims to be imported first, so the rule's configuration should mention that shims should appear in the first import group. Then, it's just a matter of differentiating the path to the module that contains the shims, e.g. have This seems to reflect reality and does not require any hacks with disabling tslint 🙂 |
@Gelio thanks for the clarification. Performing matching on the left side operand would be neat but the right side differentiation is workable with the right naming conventions and/or file structure as you elaborated upon. In my case, I only need the "dotenv" to be loaded at the top so I did an exact match against the string. If I have the time, I will try and contribute to the project. Thank you for an awesome npm module - my team loves it. |
No description provided.
The text was updated successfully, but these errors were encountered: