Skip to content

Commit

Permalink
feat(linter): add @typescript-eslint/consistent-type-imports rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryven committed Jun 30, 2024
1 parent 2e7389d commit 48c800f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ fn no_import_type_annotations_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn(
"typescript-eslint(consistent-type-imports): `import()` type annotations are forbidden.",
)
.with_labels([span.into()])
.with_label(span)
}

fn avoid_import_type_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn(
"typescript-eslint(consistent-type-imports): Use an `import` instead of an `import type`.",
)
.with_labels([span.into()])
.with_label(span)
}
fn type_over_value_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn( "typescript-eslint(consistent-type-imports): All imports in the declaration are only used as types. Use `import type`."
)
.with_labels([span.into()])
.with_label(span)
}

fn some_imports_are_only_types_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic {
OxcDiagnostic::warn(format!(
"typescript-eslint(consistent-type-imports): Imports {x1} are only used as type."
))
.with_labels([span0.into()])
.with_label(span0)
}

#[derive(Debug, Default, Clone)]
Expand Down

0 comments on commit 48c800f

Please sign in to comment.