bcomnes / sublime-standard-format

:sparkles: Runs standard --fix against the javascript in your ST3 window on save or manually.
https://packagecontrol.io/packages/StandardFormat
MIT License
60 stars 21 forks source link

configurable formatter cmd #24

Closed Flet closed 4 years ago

Flet commented 9 years ago

Hey @bcomnes are you opposed to making the formatter cmd configurable? It would be nice to perhaps support semistandard-format with this same plugin

bcomnes commented 9 years ago

I believe it already is! Check the default cofig. As long as it accepts a stdin > stdout interface, it should work. Fully open to fixing any barriers.

Flet commented 9 years ago

Ah cool I will check :)

bcomnes commented 9 years ago

Pass in strings and arguments as a string array to the (I think) command field. Mobile ATM. Can check later

leesei commented 8 years ago

The config works, I suppose this can be closed.

{
    "format_on_save": false,

    "PATH": ["/home/leesei/.nvm/versions/node/v0.12.7/bin"],

    // array of extensions to format on save
    "extensions": ["js"],

    // Array of command and flags to run against.
    // Content will be piped into this command
    // This is a string array that is passed to subprocess
    "command": ["semistandard", "-F", "--stdin"],

    // Pop up error window on formatting errors
    "loud_error": false
}