Skip to content

CLI: --list-different + --write = Exit status 1 if something was modified #4144

@thorn0

Description

@thorn0

It doesn't play very well with npm scripts:

d:\dev\foo>npm run format

> @ format d:\dev\foo
> prettier --write --list-different *.js

foo.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ format: `prettier --write --list-different *.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ format script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Without --list-different though it doesn't behave like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliIssues with Prettier's Command Line Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions