Skip to content

🐛 --reporter rdjson outputs fix description instead of code #10477

Description

@lgarron

Environment information

Details
CLI:
  Version:                      2.4.14
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v26.0.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         bun/1.3.14

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.jsonc
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  true
  HTML full support enabled:    unset

Workspace:
  Open Documents:               0

What happened?

See chromium/permission.site#155 (comment)

Image

I'm trying to hook up Biome to pull request comments: #10286 (reply in thread)

I tried triggering a linter fix by using let instead of const. But the --reporter=rdjson. Even after a bunch of work, the output of Biome seems to output a suggestion with a description of the fix rather than the fix itself:

{
  "source": {
    "name": "Biome",
    "url": "https://biomejs.dev"
  },
  "diagnostics": [
    {
      "code": {
        "url": "https://biomejs.dev/linter/rules/use-const",
        "value": "lint/style/useConst"
      },
      "location": {
        "path": "index.js",
        "range": {
          "end": {
            "column": 14,
            "line": 342
          },
          "start": {
            "column": 11,
            "line": 342
          }
        }
      },
      "message": "This let declares a variable that is only assigned once.",
      "suggestions": [
        {
          "range": {
            "end": {
              "column": 23,
              "line": 342
            },
            "start": {
              "column": 15,
              "line": 342
            }
          },
          "text": "Safe fix: Use const instead."
        }
      ]
    }
  ]
}

I think this might be a bug tracing back to https://github.com/biomejs/biome/pull/7698/changes

Expected result

The suggestions can be applied as code fixes.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: CLIS-Bug-confirmedStatus: report has been confirmed as a valid bug

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions