该规则禁止使用循环依赖。
// code-linter.json5 { "rules": { "@security/no-cycle": "error" } }
该规则无需配置选项。
// foo.ets import {} from './bar'; // bar.ets import {} from './index';
// foo.ets import {} from './bar'; // bar.ets import {} from './foo';
反例中foo.ets文件依赖了bar.ets文件,bar.ets文件同时依赖了foo.ets文件,造成了循环依赖。
plugin:@security/all
Code Linter代码检查规则的配置指导请参考Code Linter代码检查。