That's nice Charlie-- I didn't realize prettier fixed other things like JSON too.
Here's my BBEdit shell script https://github.com/isao/shell/blob/master/bbedit/Scripts/lint.sh It will fix and/or report lint issues. Added JSON just now after seeing your script. On Sunday, September 20, 2020 at 4:44:03 PM UTC-7 Charlie Garrison wrote: > On 19 Sep 2020, at 3:48, James Reynolds wrote: > > I know BBEdit has an HTML formatter. Can it also format code? Like what > https://beautifier.io/ does for JavaScript? > > BBEdit has fantastic support for Text Filters. So if your formatter of > choice works via CLI, writing a formatter (prettifier) is fairly trivial. > > I have attached the filter script I use, which auto-detects language and > applies appropriate command. It should be easy to swap out prettier for > beautifier. > > I set a keyboard shortcut for the filter, so it's as simple to use as the > built-in formatting - select the text to format, type shortcut. (No > selection will format the whole document.) > > -cng > > -- > > Charlie Garrison <[email protected]> > Garrison Computer Services <http://www.garrison.com.au> > PO Box 380 > Tumbarumba NSW 2653 Australia > > -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/c84ed714-a35a-434c-a8c3-f77825491c44n%40googlegroups.com.
