This repository was archived by the owner on Aug 31, 2023. It is now read-only.
Should rome check --apply{,-suggested}
report unfixed errors and exit 1 if any?
#3837
jeysal
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Coming from #3767 (comment), where we discovered that there is not currently an easy replacement for
eslint --fix x.js
, becauserome check --apply x.js
does not print unfixed errors and exit 1 if there are any.I'm suggesting that
rome check --apply
, likerome check
without--apply
, print the remaining errors after applying all safe fixes, and exit with code 1 if there are any. Likewise,rome check --apply-suggested
should print remaining errors after applying all safe and unsafe fixes, and exit with code 1 if there are any.This not only aligns with ESLint, but also makes more sense in terms of CLI design IMO. A subcommand should always do in principle the same thing, and flags should only alter its behavior but not make it do something else entirely.
As is,
rome check --apply
is actually more of a separate command (like arome apply
orrome fix
) because it has no overlap in FS outputs or in Console output withrome check
without--apply
(one makes no file changes and outputs a list of errors, one makes possible file changes and outputs a summary of them).The suggested
rome check
would always output a list of errors, and adding the--apply
flag would (logically speaking) alter it to first try to fix errors before then proceeding with the normalrome check
behavior.Beta Was this translation helpful? Give feedback.
All reactions