Skip to content

🐛 --reporter=json mishandles some path separators on Windows #9899

@Atulin

Description

@Atulin

Environment information

Details
❯ bunx biome rage         
CLI:
  Version:                      2.4.8
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

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:                         unset
  JS_RUNTIME_VERSION:           v24.10.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         bun/1.3.10

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?

bunx biome check . --reporter=json-pretty
{
	"severity": "error",
	"message": "The imports and exports are not sorted.",
	"category": "assist/source/organizeImports",
	"location": {
		"path": "typescript\src\account\setup-passkey.tsx",
		"start": { "line": 1, "column": 1 },
		"end": { "line": 6, "column": 26 }
	},
	"advices": []
},

The path uses unescaped backslashes, which makes the JSON invalid.

Expected result

{
	"severity": "error",
	"message": "The imports and exports are not sorted.",
	"category": "assist/source/organizeImports",
	"location": {
		"path": "typescript/src/account/setup-passkey.tsx",
		"start": { "line": 1, "column": 1 },
		"end": { "line": 6, "column": 26 }
	},
	"advices": []
},

or

{
	"severity": "error",
	"message": "The imports and exports are not sorted.",
	"category": "assist/source/organizeImports",
	"location": {
		"path": "typescript\\src\\account\\setup-passkey.tsx",
		"start": { "line": 1, "column": 1 },
		"end": { "line": 6, "column": 26 }
	},
	"advices": []
},

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 buggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions