cosmjs icon indicating copy to clipboard operation
cosmjs copied to clipboard

fix cyclical dependencies

Open dynst opened this issue 6 months ago • 1 comments

eslint-plugin-import 2.27+ warns about these:

[@cosmjs/stargate]:
[@cosmjs/stargate]: cosmjs/packages/stargate/src/index.ts
[@cosmjs/stargate]:   6:1  warning  Dependency cycle via ./distribution/aminomessages:29  import/no-cycle
[@cosmjs/stargate]:
[@cosmjs/stargate]: cosmjs/packages/stargate/src/modules/distribution/aminomessages.ts
[@cosmjs/stargate]:   10:1  warning  Dependency cycle via ./modules:107  import/no-cycle
[@cosmjs/stargate]:
[@cosmjs/stargate]: cosmjs/packages/stargate/src/modules/index.ts
[@cosmjs/stargate]:   19:1  warning  Dependency cycle via ../..:10  import/no-cycle
[@cosmjs/stargate]:
[@cosmjs/stargate]: cosmjs/packages/stargate/src/modules/staking/aminomessages.ts
[@cosmjs/stargate]:   15:1  warning  Dependency cycle via ./modules:107  import/no-cycle
[@cosmjs/stargate]:
[@cosmjs/stargate]: cosmjs/packages/stargate/src/signingstargateclient.ts
[@cosmjs/stargate]:   27:1  warning  Dependency cycle via ./distribution/aminomessages:29=>../..:10  import/no-cycle
[@cosmjs/stargate]:
[@cosmjs/stargate]: cosmjs/packages/stargate/src/stargateclient.ts
[@cosmjs/stargate]:   14:1  warning  Dependency cycle via ./distribution/aminomessages:29=>../..:10  import/no-cycle
[@cosmjs/stargate]:
[@cosmjs/stargate]: ✖ 6 problems (0 errors, 6 warnings)
[@cosmjs/stargate]:
[@cosmjs/stargate]: ESLint found too many warnings (maximum: 0).

dynst avatar Jun 12 '25 21:06 dynst

I would consider this low priority. Cyclical dependencies inside of a package are not the most beautiful thing in the world but also not an issue at all. This is well supported and common in many other languages where the whole module is preprocessed into a single file before compilation. Disabling import/no-cycle is good.

webmaster128 avatar Jul 31 '25 13:07 webmaster128