You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(linter/consistent_type_imports): Add missing help and notes to diagnostics (oxc-project#19827)
Added .with_help() and .with_note() to missing diagnostics in the typescript consistent_type_imports.rs file.
Part of oxc-project#19121
---------
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
OxcDiagnostic::warn("`import()` type annotations are forbidden.").with_label(span)
27
+
OxcDiagnostic::warn("`import()` type annotations are forbidden.")
28
+
.with_help("Replace `import()` type annotations with a regular type import. For example, change `type T = import('module').Type` to `import type { Type } from 'module'; type T = Type`.")
OxcDiagnostic::warn("Use an `import` instead of an `import type`.").with_label(span)
33
+
OxcDiagnostic::warn("Use an `import` instead of an `import type`.")
34
+
.with_help("Replace the `import type` declaration with a regular `import` declaration. For example, `import type { Type } from 'module'` would become `import { Type } from 'module'`.")
OxcDiagnostic::warn("All imports in the declaration are only used as types. Use `import type`.")
39
+
.with_help("Replace the `import` declaration with `import type`. For example, change `import { Type } from 'module'` would become `import type { Type } from 'module'`.")
40
+
.with_note("Using `import type` for type-only imports helps with tree-shaking, makes it clear that these imports don't affect runtime code, and can improve build performance by allowing bundlers to eliminate unused type imports.")
0 commit comments