biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.28k stars 475 forks source link

🐛 The organizeImports conflicts with the linting rule noUnusedImports #4282

Closed Florian-crg closed 3 weeks ago

Florian-crg commented 3 weeks ago

Environment information

CLI:
  Version:                      1.9.1
  Color support:                true

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:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

  1. noUnusedImports fix is disabled in biome.json file

    "noUnusedImports": {
    "level": "error",
    "fix": "none"
    }
  2. removeUnusedImports is disabled in VScode user config (no existing workspace config that could be conflicting)

    "editor.codeActionsOnSave": {
    "source.organizeImports": "explicit",
    "source.removeUnusedImports": "never",
     "source.removeUnused.ts": "never",
    "quickfix.biome": "explicit"
    }

Expected result

  1. I expect to not remove unused import when noUnusedImports fix is disabled in biome.json config file.
  2. I expect to not remove unused import when removeUnusedImports is disabled in the editor config.

Code of Conduct

github-actions[bot] commented 3 weeks ago

Hello @Florian-crg, please provide a minimal reproduction. You can use one of the following options:

Issues marked with S-Needs repro will be closed if they have no activity within 3 days.