Skip to content

Commit

Permalink
Merge pull request #1370 from alex-page/master
Browse files Browse the repository at this point in the history
Docs: no cycle, split code examples so file separation is obvious
  • Loading branch information
ljharb committed May 28, 2019
2 parents cf5573b + d27aeaf commit ca4bf95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/rules/no-cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ This includes cycles of depth 1 (imported module imports me) to `Infinity`, if t
import './dep-a.js'

export function b() { /* ... */ }
```

```js
// dep-a.js
import { b } from './dep-b.js' // reported: Dependency cycle detected.
```
Expand All @@ -36,12 +38,16 @@ There is a `maxDepth` option available to prevent full expansion of very deep de

// dep-c.js
import './dep-a.js'
```

```js
// dep-b.js
import './dep-c.js'

export function b() { /* ... */ }
```

```js
// dep-a.js
import { b } from './dep-b.js' // not reported as the cycle is at depth 2
```
Expand Down

0 comments on commit ca4bf95

Please sign in to comment.