Query module UnstableCyclicImport

name
Unstable cyclic import
description
If the top-level of a module accesses a variable from a cyclic import, its value depends on which module is globally imported first.
kind
problem
problem.severity
warning
id
js/unstable-cyclic-import
tags
maintainability
precision
low

Imports

javascript

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

Predicates

anyModule
cycleAlert

This is the main alert definition.

getARuntimeImport

Gets an import in source that imports destination at runtime.

getFirstCandidateAccess

Gets the first candidate access to a variable imported by the given import declaration.

isAmbientImport

Holds if the given import is only used to import type names, hence has no runtime effect.

isImmediatelyExecutedContainer

Holds if the contents of the given container are executed as part of the top-level code, and it is unreachable after top-level execution.

isImportedAtRuntime
numberOfStepsToModule

Holds if the length of the shortest sequence of runtime imports from source to destination is steps.

pathToModule

Builds a string visualizing the shortest import path from source to destination, excluding the destination.

repr

Gets the name of the module containing the given import.

Classes

CandidateVarAccess

A variable access that is executed as part of the top-level and is not part of an export.