You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added a test case to better describe the issue here: #2438
If you import a file from a folder that has the import/no-cycle rule disabled into a folder that has the rule enabled and that file contains a cycle the linter errors.
This is annoying in cases where we have cycles in our codebase that we want to ignore, but we can't do so by just disabling the rule for the folder they belong to as any code that ends up referencing them from anywhere outside at any point fails the lint, ignoring all of these cases as the depth of imports grows becomes unmanageable.
The text was updated successfully, but these errors were encountered:
I have the same problem and I can elaborate my case.
We have most of the cycles in our code base that come from a small set of interlinked files.
We can't solve it until we do a bigger refactoring but that kind of refactoring will be possible only in the future.
For now we want to get rid of all the other cycles and to have a check to prevent new ones from entering the code base.
So the idea is that when the cycle check enters some of those files it should stop.
I found no way of doing it.
Specifying an override for those file exclude them as starting point for the check but if other import them I still get the error.
Setting all enabled as warning is not an option because new cycles would be lost inside the noise.
{overrides: [{files: ['path/to/ignored/files.ts], // or use a glob pattern if all your ignored files are in specific folders
extends: ['plugin:import/recommended'],rules: {'import/no-cycle': 'warn',},},],}
I have added a test case to better describe the issue here: #2438
If you import a file from a folder that has the
import/no-cycle
rule disabled into a folder that has the rule enabled and that file contains a cycle the linter errors.This is annoying in cases where we have cycles in our codebase that we want to ignore, but we can't do so by just disabling the rule for the folder they belong to as any code that ends up referencing them from anywhere outside at any point fails the lint, ignoring all of these cases as the depth of imports grows becomes unmanageable.
The text was updated successfully, but these errors were encountered: