#Install
npm install --global prettier
npm i -g esformatter
-
Open preferences
Command ,
-
Run below script to find the path and copy the path as instructed below
echo $(npm bin -g)/node $(npm bin -g)/prettier --write \"\$file\"
Copy down the output as TypeScript Custom Code Formatter Path and it is like below.
/home/ec2-user/.nvm/versions/node/v16.14.2/bin/node /home/ec2-user/.nvm/versions/node/v16.14.2/bin/prettier --write "$file"
Note: Make sure you enabled autosave by going into experimental section and enable autosave after time delay.