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
In a project setup with yarn workspaces, no-cycle fails to recognize a @scope/package package as external, even if the path is under node_modules. The reason is that no-cycle uses isExternalModule:
Actually, my motivation is actually not necessarily considering the import external. But making sure that no-cycle reads the target file with the right settings from the target .eslintrc! This was more of a workaround.
In a project setup with yarn workspaces,
no-cycle
fails to recognize a@scope/package
package as external, even if the path is undernode_modules
. The reason is thatno-cycle
usesisExternalModule
:https://github.com/benmosher/eslint-plugin-import/blob/master/src/rules/no-cycle.js#L44
but there is a regex condition that says that module is not "external", but "scoped".
https://github.com/benmosher/eslint-plugin-import/blob/3e65a70bc73e404ace72ee858889e39732284d12/src/core/importType.js#L45
I think the right solution for consistency is to use
resolveImportType
fromimportType
?https://github.com/benmosher/eslint-plugin-import/blob/master/src/core/importType.js#L83-L93
Alternatively, replace the regular expression with "anything that does not start with a
.
.The text was updated successfully, but these errors were encountered: