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.
Top comments (0)