Hisyam Johan
Posted on August 15, 2022
Bismillah.
Prettier Configuration on VS Code
- Install Prettier Plugin:
- Open VS Code.
- Go to Extensions and search for "Prettier".
- Install the Prettier extension.
- Modify Setting
- Navigate to Preferences > Settings.
- Search for @lang:javascript settings.
- Click "Edit in settings.json" and add:
{
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Prettier Configuration on IntelliJ IDEA
- Install Prettier Globally:
- Run
yarn global add prettier
in the command line.
- Install Prettier Plugin:
- Open IntelliJ.
- Go to the Plugins section and search for "Prettier".
- Install the Prettier plugin.
- Modify Settings:
- Navigate to Settings.
- Search for Prettier.
- Select the Prettier package.
- Enable "On Reformat Code" and "On Save" actions.
- Click Apply.
Now, both VS Code and IntelliJ will automatically format your code using Prettier on save.
💖 💪 🙅 🚩
Hisyam Johan
Posted on August 15, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.