Skip to content

💅 useImportType: expected error with inlineType but got none #7289

@OliverJAsh

Description

@OliverJAsh

Environment information

CLI:
  Version:                      2.2.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  BIOME_THREADS:                unset
  NO_COLOR:                     unset
  TERM:                         xterm-ghostty
  JS_RUNTIME_VERSION:           v22.17.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         npm/10.9.2

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  false

Workspace:
  Open Documents:               0

Rule name

useImportType

Playground link

https://github.com/OliverJAsh/biome-repro-1755806942670

Expected result

Given:

{
    "options": {
        "style": "inlineType"
    }
}

I expected this to error:

import type { T } from './foo';

… with a fix resolving to:

import { type T } from './foo';

But it does not error.

The reason I want to enforce this import style is because it makes merge conflicts easier to resolve.

For comparison, the inverse with separatedType does error as I expect:

{
    "options": {
        "style": "separatedType"
    }
}

This results in an error:

import { type T } from './foo';

… with a fix resolving to:

import type { T } from './foo';

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions