treefmt icon indicating copy to clipboard operation
treefmt copied to clipboard

Prettier through `--stdin` does no formatting

Open losnappas opened this issue 2 months ago • 6 comments

Describe the bug

I run e.g. treefmt --stdin test.js < test.js, but no changes. Neither for json files. But file does change if I run treefmt test.js.

To Reproduce

Steps to reproduce the behavior:

I am using treefmt-nix, with this:

treefmt = {
  programs = {
    prettier.enable = true;
  };
};
const x = () => {
    console.log( "zxc " );
    };
  1. nix fmt -- --stdin test.js < test.js
  2. Outputs the same content as went in, no changes.
  3. For reference, nix fmt -- --stdin flake.nix < flake.nix does output changes (when needed)
  4. nix fmt results in formatted js file

Expected behavior

It should format the JS through stdin via prettier.

System information

nixos-unstable 01f116e4df6a15f4ccdffb1bcd41096869fb385c treefmt v2.4.0

Additional context

losnappas avatar Oct 24 '25 06:10 losnappas