commit 4b4cf0e56882bf6d774614b8c0c3a0dafe6cd3ea from: Oliver Lowe date: Sat Sep 17 01:48:34 2022 UTC 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. commit - d54fc62b4de7bf18546d225fd5402ff4a72a536c commit + 4b4cf0e56882bf6d774614b8c0c3a0dafe6cd3ea blob - /dev/null blob + cf54ebfcd464f5945ee9d40612b44f50738b93d8 (mode 755) --- /dev/null +++ bin/jsfmt @@ -0,0 +1,3 @@ +#!/bin/sh + +npx prettier --parser flow $@ blob - /dev/null blob + ed749b1e68fe856f537e04e2f79bc25dea3a083c (mode 644) --- /dev/null +++ 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