-
Command Palette
"Ctrl/Cmd + Shift + P", then type "JsPrettier Format Code".
-
Context Menu
Right-click the file view and select "JsPrettier Format Code".
-
Key Binding
There is no default key binding for this plug-in.
To add a key binding, navigate to "Preferences" -> "Key Bindings...", and add an entry for "js_prettier". For example...
{ "keys": ["shift+alt+f"], "command": "js_prettier" }
Change "shift+alt+f" with your preferred key combination.
If Sublime Text has problems resolving the absolute path to node, you can set a custom path here.
Examples:
{
// macOS/Linux:
"node_path": "/usr/local/bin/node"
"node_path": "/some/absolute/path/to/node"
"node_path": "./node"
"node_path": "~/bin/node"
"node_path": "$HOME/bin/node"
"node_path": "${project_path}/bin/node"
"node_path": "$ENV/bin/node"
"node_path": "$NVM_BIN/node"
// Windows:
"node_path": "C:/path/to/node.exe"
"node_path": "%USERPROFILE%\\bin\\node.exe"
}