Please provide a clear and concise description of what the bug is.
There is a big divergence between what config is used by stdin mode, and what happens when formatting the whole repo. In stdin mode, biome is completely ignoring non-root configs. This prevents biome being usable with jj fix, which only supports stdin mode.
As I understood it, the entire point of the --stdin-file-path flag is to allow biome to do config discovery exactly as if you ran biome format THATFILENAME.js. It is in fact documented on the Check { stdin_file_path } flag in biome_cli that the provided path should determine which override configs are applied. I haven't got it to work with check either, for the record. I can't fathom writing a tool like this from scratch with two different config discovery pipelines, so this is probably from a big code path migration from v1 to v2 or something that was not completed.
See linked repository https://github.com/cormacrelf/biome-nested-config-repro, whose readme shows a breakdown of what works and what doesn't.
Surprise
Biome is in fact reading the subdirectory configuration. And then ignoring it!
; strace biome format --stdin-file-path=subdirectory/lib.js < subdirectory/lib.js 2>&1 1>/dev/null | rg 'openat.*biome'
openat(AT_FDCWD, "/home/user/newfolder/biome.json", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/user/newfolder/biome.jsonc", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/user/newfolder/biome.jsonc", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/user/newfolder/subdirectory/biome.jsonc/biome.json", O_RDONLY|O_CLOEXEC) = -1 ENOTDIR (Not a directory)
openat(AT_FDCWD, "/home/user/newfolder/subdirectory/biome.jsonc/biome.jsonc", O_RDONLY|O_CLOEXEC) = -1 ENOTDIR (Not a directory)
openat(AT_FDCWD, "/home/user/newfolder/subdirectory/biome.json", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/user/newfolder/subdirectory/biome.jsonc", O_RDONLY|O_CLOEXEC) = 3
Whereas when formatting a root js file:
strace biome format --stdin-file-path=app.js < app.js 2>&1 1>/dev/null | rg 'openat.*biome'
openat(AT_FDCWD, "/home/user/newfolder/biome.json", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/user/newfolder/biome.jsonc", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/user/newfolder/biome.jsonc", O_RDONLY|O_CLOEXEC) = 3
Environment information
CLI:
Version: 2.3.5
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
NO_COLOR: unset
TERM: alacritty
JS_RUNTIME_VERSION: unset
JS_RUNTIME_NAME: unset
NODE_PACKAGE_MANAGER: unset
Biome Configuration:
Status: Loaded successfully
Path: biome.jsonc
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: false
Formatter:
Format with errors: unset
Indent style: Space
Indent width: 4
...
(everything else unset)
Configuration
{ "please": "see linked repository, this is about nested config",
"also": "the bug report template is broken, there is no field for description" }
Playground link
https://github.com/cormacrelf/biome-nested-config-repro
Code of Conduct
Please provide a clear and concise description of what the bug is.
There is a big divergence between what config is used by stdin mode, and what happens when formatting the whole repo. In stdin mode, biome is completely ignoring non-root configs. This prevents biome being usable with
jj fix, which only supports stdin mode.As I understood it, the entire point of the
--stdin-file-pathflag is to allow biome to do config discovery exactly as if you ranbiome format THATFILENAME.js. It is in fact documented on theCheck { stdin_file_path }flag in biome_cli that the provided path should determine which override configs are applied. I haven't got it to work with check either, for the record. I can't fathom writing a tool like this from scratch with two different config discovery pipelines, so this is probably from a big code path migration from v1 to v2 or something that was not completed.See linked repository https://github.com/cormacrelf/biome-nested-config-repro, whose readme shows a breakdown of what works and what doesn't.
Surprise
Biome is in fact reading the subdirectory configuration. And then ignoring it!
Whereas when formatting a root js file:
Environment information
Configuration
{ "please": "see linked repository, this is about nested config", "also": "the bug report template is broken, there is no field for description" }Playground link
https://github.com/cormacrelf/biome-nested-config-repro
Code of Conduct