-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linter/import): Add
ignoreTypes
option for the `import/no-cycl…
…e` rule (#2905) Fixes: #2904 Adds an `ignoreTypes` option for the `import/no-cycle` rule, to ignore imports that don't have any runtime effect.
- Loading branch information
Showing
6 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
crates/oxc_linter/fixtures/import/cycles/typescript/ts-types-depth-two.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @ts-ignore | ||
import type { foo } from '../es6/depth-one'; |
2 changes: 2 additions & 0 deletions
2
...es/oxc_linter/fixtures/import/cycles/typescript/ts-types-only-importing-multiple-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @ts-ignore | ||
import { type foo, type bar } from '../depth-zero'; |
2 changes: 2 additions & 0 deletions
2
crates/oxc_linter/fixtures/import/cycles/typescript/ts-types-only-importing-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @ts-ignore | ||
import type { foo } from '../depth-zero'; |
3 changes: 3 additions & 0 deletions
3
crates/oxc_linter/fixtures/import/cycles/typescript/ts-types-some-type-imports.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// @ts-ignore | ||
|
||
import { foo, type BarType } from '../depth-zero'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters