-
Notifications
You must be signed in to change notification settings - Fork 25
Usage with jsfmt
Roy Riojas edited this page May 5, 2016
·
2 revisions
Please follow these instructions
# go to the jsfmt package folder
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/jsfmt/
There run
# install both esformatter and esformatter-jsx
npm i esformatter@latest esformatter-jsx@latest
make sure you don't have other esformatter instances
npm ls esformatter
npm ls esformatter-jsx
The output from the commands above should only display the latest esformatter/esformatter-jsx versions.
// add to your
{
"extensions":
[
"js",
"jsx",
"sublime-settings"
],
"options": {
"plugins": [
"esformatter-jsx",
],
"jsx": {
"formatJSX": true,
// change these to your preferred values
// refer to https://github.com/royriojas/esformatter-jsx#best-configuration for more options
"attrsOnSameLineAsTag": false,
"maxAttrsOnTag": 1,
"firstAttributeOnSameLine": false,
"alignWithFirstAttribute": true
}
// other esformatter options
}
}
-
Make sure you're using the latest version of
esformatter
andesformatter-jsx
. Make sure there are not other versions of the module in anynode_modules
folder inside thejsfmt
folder -
Make sure you have added the
jsx
block to thejsfmt.sublime-settings
file for the user preferences. -
File a bug in either the
jsfmt
repo oresformatter-jsx
repo. I will happily try to help you make it work!