sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

Run prettier-standard in Sublime Text 3? #41

Closed mesqueeb closed 6 years ago

mesqueeb commented 6 years ago

Is this already possible? I couldn't figure out how to do this.

sheerun commented 6 years ago

You probably can use https://github.com/jonlabelle/SublimeJsPrettier and change prettier_cli_path to prettier-standard

On Wed, Jan 24, 2018 at 2:48 PM, Luca Ban notifications@github.com wrote:

Is this already possible? I couldn't figure out how to do this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sheerun/prettier-standard/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR2DfDuITPDqQqlKR1-VXngDKo8jYdPks5tNtIwgaJpZM4Rqy18 .

mesqueeb commented 6 years ago

Dear @sheerun

After installing SublimeJsPrettier I found this in the settings:

    // ----------------------------------------------------------------------
    // Prettier CLI Path
    // ----------------------------------------------------------------------
    //
    // @param {string} "prettier_cli_path"
    // @default ""
    //
    // It's recommended to leave the "prettier_cli_path" value empty "".
    // However, if Sublime Text has problems resolving the path to the
    // `prettier` cli executable, you can explicitly specify the path here.
    //
    // If the `prettier_cli_path` setting is left empty (""), the path is
    // resolved by searching locations in the following order, returning the
    // first matched path:
    //
    // - Locally installed prettier, relative to the Sublime Text Project file's
    //   root directory, e.g.: `node_modules/.bin/prettier'.
    // - The user's home directory, e.g.: `$HOME/node_modules/.bin/prettier`.
    // - Look in the JsPrettier Sublime Text plug-in directory for
    //   `node_modules/.bin/prettier`.
    // - Finally, check if prettier is installed globally,
    //   e.g.: `yarn global add prettier`
    //     or: `npm install -g prettier`
    //
    // nvm users are required to set an appropriate absolute `prettier_cli_path`
    // (and absolute `node_path`), according to the target runtime environment.
    //
    // Examples:
    //
    //     - macOS/Linux...: "/path/to/node_modules/.bin/prettier" (absolute)
    //                   or  "./node_modules/.bin/prettier" (relative)
    //     - Windows.......: "C:/path/to/npm/prettier" (absolute)
    // ----------------------------------------------------------------------

    "prettier_cli_path": "",

To what do I need to change this line?

"prettier_cli_path": "",

Best regards.

sheerun commented 6 years ago

It depends if you're on windows or unix. If unix then you can type which prettier-standard in terminal to know the path. On windows it's probably where prettier-standard, but I don't own one.

mesqueeb commented 6 years ago

This works. I'll update the readme to include this.

mesqueeb commented 6 years ago

Just made the pull request. Please check.

alphashuro commented 6 years ago

Why is this so slow though?