trixnz / lua-fmt

lua-fmt is pretty-printer for Lua code
MIT License
189 stars 25 forks source link

Add ability to format multiple files at once #41

Closed 13k closed 2 years ago

13k commented 5 years ago

Uses globby to list files matched by a pattern, pretty much like prettier's CLI does.

It supports passing multiple filenames/patterns. I'm using the same globby options as prettier (include dotfiles).

It does not ignore any files, but it should be desirable to implement after this initial work.

Also, I didn't modify the output for stdout and diff write modes, so they will simply print the output sequentially for all matched files, which can be useless (in stdout mode for multiple files) or too cluttered (in diff mode).

Finally, I took the liberty to upgrade some dependencies (notably: typescript, tslint, jest), since they weren't working properly with newer node versions (10.x). I hope that isn't too intrusive.