Skip to content

Prettier through --stdin does no formatting #644

@losnappas

Description

@losnappas

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions