Eslint-plugin-import: no-cycle: consider deep require calls

Created on 30 Mar 2018  路  6Comments  路  Source: benmosher/eslint-plugin-import

Just making a note to come back to no-cycle and capture require calls in ExportMap to check for cycles in addition to exploring import statements.

help wanted semver-minor

Most helpful comment

I'd appreciate this a lot; just fiddled with the no-cycle rule for a while, only to realize that it just doesn't work for good old regular Node.js projects (it does say so in the docs, but it's not quite obvious).

Just had a quick look at ExportMap myself, but this doesn't strike me as an easy first contribution :)

All 6 comments

I'd appreciate this a lot; just fiddled with the no-cycle rule for a while, only to realize that it just doesn't work for good old regular Node.js projects (it does say so in the docs, but it's not quite obvious).

Just had a quick look at ExportMap myself, but this doesn't strike me as an easy first contribution :)

There's eslint-plugin-dependencies that used to work with require, but it seems abandoned.
Perhaps it can be scavenged?

I'm writing some tests for this. How do you expect this to work with regards to the commonjs option? Should it look for dependency cycles in requires only if commonjs: true?

(Link to documentation)

sort of, just reverted behind the option :-) (and avoiding the crash)

Was this page helpful?
0 / 5 - 0 ratings