Query module CyclicImport

name
Cyclic module import
description
If a module indirectly imports itself, some modules involved in the import cycle may end up with partially loaded dependencies. This is error-prone and should be avoided.
kind
problem
problem.severity
warning
id
js/node/cyclic-import
tags
reliability maintainability frameworks/node.js
precision
medium

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Predicates

pp

Gets a pretty-printed name for m that distinguishes it from other: this is simply the name of m it is different from the name of other, or else a suffix of the path of m that is different from other as computed by ppDiff.

ppDiff

Gets the shortest suffix of the path of c1 that differs from the corresponding suffix of c2; if that suffix is a proper suffix, it is additionally prefixed with .../.

relatedAncestors

Holds if c1 and c2 are related modules (as determined by predicate relatedModules), or (transitive) parent folders of such modules.

relatedModules

Holds if m imports n or vice versa.