Inconsistent handling of override file paths with/without a directory
Author: l0b0Created Sep 7, 2026Updated Sep 7, 2026
Environments:
- Prettier Version: 3.9.6
- Running Prettier via: CLI
- Runtime: Node.js v24.19.0
- Operating System: NixOS
- Prettier plugins (if any): N/A
Steps to reproduce:
- Clone https://github.com/l0b0/prettier-bug-test
- Run
./succeeds.bashand note that nothing changed - Run
./fails.bash
Expected behavior:
Nothing should change, because the location of the configuration change should not affect the result.
Actual behavior:
Override paths with a directory separator are interpreted as relative to the configuration file, rather that the current working directory. That is, config/dir/regular.md and dir/exception.md both get formatted.
Source: prettier/prettier