Comment by vladvasiliu
14 hours ago
I do usually run new tools from somewhere harmless, like ~/tmp, just in case they do something unexpected.
But most formatters I'm used to absolutely don't do this. For example, `rustfmt` will read input from stdin if no argument is given. It can traverse modules in a project, but it won't start modifying everything under your CWD.
Most unix tools will either wait for some stdin or dump some kind of help when no argument is given. Hell, according to this tool's docs, even `prettier` seems to expect an argument:
> Running oxfmt without arguments formats the current directory (*equivalent to prettier --write .*)
I'm not familiar with prettier, so I may be wrong, but from the above, I understand that prettier doesn't start rewriting files if no argument is given?
Looking up prettier's docs, they have this to say:
> --write
This rewrites all processed files in place. *This is comparable to the eslint --fix* workflow.
So eslint also doesn't automatically overwrite everything?
So yeah, I can't say this is expected behaviour, even if it's documented.
a more related tool would be prettier, which also has a --write option