目录

@security/no-cycle

Disallow cyclic dependencies.

Rule Configuration

// code-linter.json5
{
  "rules": {
    "@security/no-cycle": "error"
  }
}

Options

This rule is not configurable.

Example of Correct Code

// foo.ets
import {} from './bar';

// bar.ets
import {} from './index';

Example of Incorrect Code

// foo.ets
import {} from './bar';

// bar.ets
import {} from './foo';

In the preceding example, the foo.ets file depends on the bar.ets file, and the bar.ets file also depends on the foo.ets file, resulting in a cyclic dependency.

Rule Set

plugin:@security/all

For details about how to configure Code Linter check rules, see Code Linter.