Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rupeshtiwari/d2919084e92304a240d357a7dbb23c39 to your computer and use it in GitHub Desktop.
Save rupeshtiwari/d2919084e92304a240d357a7dbb23c39 to your computer and use it in GitHub Desktop.
AWS Cloud9 typescript formatter

AWS Cloud9 typescript formatter

Step 1: Install node packages

#Install
npm install --global prettier
npm i -g esformatter

Step 2: Copy Custom Code Formatter Path

  1. Open preferences Command ,

  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment