no-cycle
Configuration
Rule Details
Ensures that an imported module does not have a resolvable dependency path back to the linted module.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
This rule does not report direct self imports. Use import/no-self-import for
that case.
Type-only imports are ignored because they have no runtime effect. Named
type-only re-exports still participate in the dependency graph, matching
eslint-plugin-import.
Options
maxDepth
Limits how far the rule traverses the dependency graph. The value must be a
positive integer or "∞".
commonjs
Checks require() calls in addition to ES module imports.
amd
Checks AMD require([...]) and define([...]) dependencies.
ignoreExternal
Skips modules treated as external, such as modules under node_modules.
allowUnsafeDynamicCyclicDependency
Allows a cycle when at least one dependency in the cycle is imported with
dynamic import().