commit 4b4cf0e56882bf6d774614b8c0c3a0dafe6cd3ea parent d54fc62b4de7bf18546d225fd5402ff4a72a536c Author: Oliver Lowe <o@olowe.co> Date: Sat, 17 Sep 2022 11:48:34 +1000 import jsfmt, a wrapper of prettier It's like gofmt but for javascript. It wraps prettier (https://prettier.io) to give a more traditional unix-like CLI. And I can't remember which flags are required and what the program is even called. Diffstat:
| A | bin/jsfmt | | | 3 | +++ |
| A | man/jsfmt.1 | | | 23 | +++++++++++++++++++++++ |
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/bin/jsfmt b/bin/jsfmt @@ -0,0 +1,3 @@ +#!/bin/sh + +npx prettier --parser flow $@ diff --git a/man/jsfmt.1 b/man/jsfmt.1 @@ -0,0 +1,23 @@ +.Dd +.Dt JSFMT 1 +.Sh NAME +.Nm jsfmt +.Nd format javascript source code +.Sh SYNOPSIS +.Nm +.Op Fl w +.Op Ar +.Sh DESCRIPTION +.Nm +copies the given javascript source files +.Pq standard input if none specified +to the standard output after formatting with +.Xr prettier 1 . +.Pp +The +.Fl w +flag causes the files to be edited in place. +.Sh EXIT STATUS +.Ex +.Sh SEE ALSO +.Lk https://prettier.io The prettier project website