Skip to content

biome check --stdin-file-path=file.ts doesn't return stdout #3633

@janos-r

Description

@janos-r

Environment information

CLI:
  Version:                      1.8.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.6.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

  1. Use a index.ts file with unsorted imports, and necessary formatting
  2. run biome format index.ts -> see diff output
  3. run cat index.ts | biome format --stdin-file-path=file.ts -> see the result of that diff in standard output
  4. try the previous two steps with check instead of format -> The first output is as expected. But the pipe output makes no sense! It is one part original (unchanged) standard output, and second part the previous format diff.

Expected result

To get just the standard output of both diffs applied.

I am using the biome format --stdin-file-path to format code in helix for a while, this works well. But I tried to add also import sorting today. And to have that working, I would expect to just change the word format to check and get the same standardized output when providing the --stdin-file-path - the official docs say the same.
https://biomejs.dev/reference/cli/#biome-check -> the --stdin-file-path looks the same in both check and format, but only in format you get an output that is usable for the LSP.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions