Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(useImportType): add docs about TypeScript settings #3171

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 are using the TypeScript Compiler (TSC) to transpile your code into JavaScript,
/// then you can disable this rule, as TSC is able to remove imports that are only used as types.
/// However, for consistency and compatibility with other transpilers, you nay want to enable this rule.
/// In that case we recommend to enable TSC's [verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax).
Conaclos marked this conversation as resolved.
Show resolved Hide resolved
/// This configuration ensures that TSC preserves imports that are 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.
Conaclos marked this conversation as resolved.
Show resolved Hide resolved
/// This setting is available in Visual Studio Code.
/// It ensures that the `tyupe` is used when the editor automatically imports a type.
Conaclos marked this conversation as resolved.
Show resolved Hide resolved
///
/// ## Caveat with TypeScript experimental decorators
///
/// Some frameworks like Angular and NestJS rely on
Expand Down