Skip to content

Commit

Permalink
docs(useImportType): add docs about TypeScript settings (#3171)
Browse files Browse the repository at this point in the history
Co-authored-by: Ze-Zheng Wu <[email protected]>
Co-authored-by: Emanuele Stoppa <[email protected]>
  • Loading branch information
3 people committed Jun 11, 2024
1 parent e3e93cc commit e47b8bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/biome_js_analyze/src/lint/style/use_import_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ declare_rule! {
/// The rule ensures that all imports used only as a type use a type-only `import`.
/// It also groups inline type imports into a grouped `import type`.
///
/// If you use the TypeScript Compiler (TSC) to compile your code into JavaScript,
/// then you can disable this rule, as TSC can remove imports only used as types.
/// However, for consistency and compatibility with other transpilers, you may want to enable this rule.
/// In that case we recommend to enable TSC's [`verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax).
/// This configuration ensures that TSC preserves imports not marked with the `type` qualifier.
///
/// You may also want to enable the editor setting [`typescript.preferences.preferTypeOnlyAutoImports`](https://devblogs.microsoft.com/typescript/announcing-typescript-5-3-rc/#settings-to-prefer-type-auto-imports) from the TypeScript LSP.
/// This setting is available in Visual Studio Code.
/// It ensures the `type` is used when the editor automatically imports a type.
///
/// ## Caveat with TypeScript experimental decorators
///
/// Some frameworks like Angular and NestJS rely on
Expand Down

0 comments on commit e47b8bc

Please sign in to comment.