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
As part of the no-useless-path-segments, we have a noUselessIndex option to remove unnecessary indexes. So the expected behavior works fine on relative imports:
importfoofrom'./foo/index';// flags fine
But when it comes to references from project-relative imports (e.g., absolute imports in Next), it doesn't seem to get detected:
importfoofrom'foo/index';// does not flag
Should we consider making this its own rule?
The text was updated successfully, but these errors were encountered:
No, I think this is just part of the tradeoff you make by choosing a nonstandard approach - ie, project-relative imports.
There's no reasonable and reliable way for static analysis to "just know" that bare specifier aliases reliably point to what should be relative file paths.
As part of the
no-useless-path-segments
, we have anoUselessIndex
option to remove unnecessary indexes. So the expected behavior works fine on relative imports:But when it comes to references from project-relative imports (e.g., absolute imports in Next), it doesn't seem to get detected:
Should we consider making this its own rule?
The text was updated successfully, but these errors were encountered: