Skip to content

Enable @typescript-eslint/consistent-type-imports lint rule #29

Description

@tupe12334

What

Enable the @typescript-eslint/consistent-type-imports ESLint rule (level error) for src/**/*.{ts,tsx}.

The rule flags imports that are used only as types but written as a normal value import, and requires them to use the import type { ... } form.

// flagged
import { Metadata } from "next";
// correct
import type { Metadata } from "next";

Why it improves code quality

  • Cleaner emitted output — type-only imports are fully elided by the TypeScript compiler, so they never produce a runtime require/import.
  • No accidental side effects — keeps type imports from dragging in modules (and their side effects) at runtime.
  • Bundler / isolatedModules friendly — avoids the class of build errors that arise when a type-only import is treated as a value.
  • Readability — makes the value-vs-type intent of every import explicit at a glance.

Scope / risk

The codebase already follows this convention — enabling the rule surfaces zero new violations. This change simply locks the pattern in and prevents future regressions. No production code changes required.


This issue was opened by the "Add lint rule → issue + PR (owned repos + my orgs) → Slack" routine of moadim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions