Skip to content

Commit

Permalink
[Docs] no-cycle: add disableScc to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
soryy708 authored and ljharb committed Sep 25, 2024
1 parent 743ebca commit 6218a8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
### Changed
- [Docs] [`no-relative-packages`]: fix typo ([#3066], thanks [@joshuaobrien])
- [Performance] [`no-cycle`]: dont scc for each linted file ([#3068], thanks [@soryy708])
- [Docs] [`no-cycle`]: add `disableScc` to docs ([#3070], thanks [@soryy708])

## [2.30.0] - 2024-09-02

Expand Down Expand Up @@ -1141,6 +1142,7 @@ for info on changes for earlier releases.

[`memo-parser`]: ./memo-parser/README.md

[#3070]: https://github.com/import-js/eslint-plugin-import/pull/3070
[#3068]: https://github.com/import-js/eslint-plugin-import/pull/3068
[#3066]: https://github.com/import-js/eslint-plugin-import/pull/3066
[#3065]: https://github.com/import-js/eslint-plugin-import/pull/3065
Expand Down
8 changes: 8 additions & 0 deletions docs/rules/no-cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ export function getBar() { return import('./bar'); }

> Cyclic dependency are **always** a dangerous anti-pattern as discussed extensively in [#2265](https://github.com/import-js/eslint-plugin-import/issues/2265). Please be extra careful about using this option.
#### `disableScc`

This option disables a pre-processing step that calculates [Strongly Connected Components](https://en.wikipedia.org/wiki/Strongly_connected_component), which are used for avoiding unnecessary work checking files in different SCCs for cycles.

However, under some configurations, this pre-processing may be more expensive than the time it saves.

When this option is `true`, we don't calculate any SCC graph, and check all files for cycles (leading to higher time-complexity). Default is `false`.

## When Not To Use It

This rule is comparatively computationally expensive. If you are pressed for lint
Expand Down

0 comments on commit 6218a8a

Please sign in to comment.