Remix.run Logo
Grom_PE 3 hours ago

I thought oxfmt would just be a faster drop-in replacement for "biome format"... It wasn't.

Let this be a warning: running oxfmt without any arguments recursively scans directory tree from the current directory for all *.js and *.ts files and silently reformats them.

Thanks to that, I got a few of my Allman-formatted JavaScript files I care about messed up with no option to format them back from K&R style.

tomashubelbauer 2 hours ago | parent | next [-]

> running oxfmt without any arguments recursively scans directory tree from the current directory for all .js and .ts files and silently reformats them

I've got to say this is what I would have expected and wanted to happen. I'd say it is wise to not run tools designed to edit files on files you don't have a backup for (like Git) without doing a dry-run or a small scope experiment first.

vladvasiliu 2 hours ago | parent [-]

While I can get behind things such as "use version control," "use backups", etc. this is definitely not what I'd expect from a program run without arguments, especially when it will go and change stuff.

nindalf 2 hours ago | parent | prev | next [-]

> with no option to format them back

Try git reset --hard, that should work.

jagged-chisel 3 hours ago | parent | prev | next [-]

These files are under version control, right? Or backed up. Right?

Sammi 2 hours ago | parent | prev | next [-]

This is user error. oxfmt did what you asked it to do.

rk06 2 hours ago | parent [-]

I don't think so. If someone runs a tool without args, the tool should do equivalent of "tool --help"

It is bad ux.

Sammi an hour ago | parent [-]

I expect a file formatter to format the files when I call it. Anything else would be surprising to me.

rk06 an hour ago | parent [-]

a new user should not expected to know whether to use "--info", "--help", or "-info" or "/info"

A power user can just pass the right params. Besides, it is not that hard to support "--yolo" parameter for that use case

xigoi an hour ago | parent [-]

Would you enjoy writing `rm --yolo file` instead of `rm file` every time?

user3939382 30 minutes ago | parent [-]

Not taking a position but the design of rm strengthens the position that recursive by default without flags isn’t ok. rm makes you confirm when you want changes to recurse dirs.

monster_truck 27 minutes ago | parent | prev | next [-]

You couldn't waterboard this outta me

ramon156 2 hours ago | parent | prev | next [-]

Do you not use a VCS?

phplovesong 3 hours ago | parent | prev [-]

Git undo?