Open
Description
Here is the setup (https://codesandbox.io/p/devbox/my57j6):
// a.js
import "./b";
export const f = () => globalThis.x;
// b.js
import "./c";
// c.js
import { f } from "./a";
globalThis.x = f();
This seems like a cycle to me (a.js
expects globalThis.x
to be set given that it imports b.js
which imports c.js
which sets it, but c.js
uses an import from a.js
in order to set globalThis.x
).
Yet this is not detected as a cycle by eslint-plugin-import
. Note that changing a.js
to import ./c
instead of ./b
is detected as a cycle, so it seems to be the indirection introduced by b.js
which confuses no-cycle
.