Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸ’… Biome 2.0 with JSX h factory that comes NOT from ReactΒ #6438

@Jagget

Description

@Jagget

Environment information

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.15.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/11.4.1"

Rule name

lint/correctness/noUnusedImports

Playground link

no

Expected result

After update to v2 I got a warning that I didn't see in v1.9:

The error:

src/util/DOM/SsrDataScript.tsx:1:43 lint/correctness/noUnusedImports  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ⚠ Several of these imports are unused.
  
  > 1 β”‚ import { Build, type FunctionalComponent, h } from '@stencil/core';
      β”‚                                           ^
    2 β”‚ 
    3 β”‚ const getScriptText = (dataId: number, data: unknown) => {
  
  β„Ή Unused imports might be the result of an incomplete refactoring.
  
  β„Ή Unsafe fix: Remove the unused imports.
  
    1 β”‚ importΒ·{Β·Build,Β·typeΒ·FunctionalComponent,Β·hΒ·}Β·fromΒ·'@stencil/core';
      β”‚                                           --     

With my tsconfig:

{  
  "compilerOptions": {
    "jsx": "react",  
    "jsxFactory": "h"
  }
}

and I tried 2 options for JSX factory, got the same warning.

biome.json

{  
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",  
  "assist": {  
    "actions": {  
      "source": {  
        "organizeImports": "on"  
      }  
    }  
  },
  "javascript": {  
    "jsxRuntime": "transparent/reactClassic",  // tried both options, with the same result
    "formatter": {  
      "quoteStyle": "single"  
    }  
  }
}

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-EnhancementStatus: Improve an existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions