yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Can't set false to --check-files flag #3174

Open bestander opened 7 years ago

bestander commented 7 years ago

Do you want to request a feature or report a bug? feature

What is the current behavior? Add --check-files true to .yarnrc. Then run yarn install --check-files false and see output

yarn install v0.23.2
error `install` has been replaced with `add` to add new dependencies. Run "yarn add false" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

commander.js does not allow negating flags automatically.

Please mention your node.js, yarn and operating system version. 0.23.2

shadowspawn commented 4 years ago

Just regarding the CLI and not interaction with .yarnrc: Commander does not automatically support negated version of positive flags, but you can declare negated flags where it is appropriate (i.e. declare --no-check-files). The support for having both positive and negated flag was much improved in Commander v3.

Update, Yarn 2 is using Clipanion: https://github.com/yarnpkg/yarn/issues/4225#issuecomment-669161536