Format Apex Code in VS Code using Prettier | Salesforce VS Code Tutorial
In this tutorial, we'll walk you through the steps to beautify, format your Apex Code in Visual Studio Code, while doing Salesforce Apex Development, there is no default formatter in VS Code for Apex language other than Developer Console. Prettier is one of the best code formatters and offers Apex Plugin which you can use to format your Apex Class / Code. You can also format LWC using Prettier in VS Code. 🔍 What You'll Learn : - How to install and set up Prettier in VS Code. - Configuring Prettier for Apex in your Salesforce projects. - Tips and tricks to enhance your coding experience with Prettier. Whether you're a beginner or an experienced developer, this tutorial will help you save time and improve your code quality. ⏲️ Timestamps : 00:00 Intro 00:12 Why use Prettier? 01:29 How to Install Prettier 02:03 Configure Prettier 02:32 Prettier Options 03:32 Set Default Formatter 04:14 Format Specific Apex Class 04:51 Format on Save 05:18 Format LWC JS Code 05:43 New Stuff 06:19 Outro ⌨️ VS Code Commands : **To install prettier plugin for salesforce apex / lwc : npm install --save-dev --save-exact prettier prettier-plugin-apex **To Format your current file using Prettier : npx prettier --write your-file-path-here (right click on file and select copy relative path) Links for your reference : 📌 Prettier Configuration Files for VS Code : https://bit.ly/prettier-apex-vscode-config 📌 Authenticate VS Code with Salesforce : https://bit.ly/vscode-auth-salesforce 📌 Prettier Code Formatter for Apex, Aura, and LWC : https://sforce.co/4fMMRFH 📌 Prettier Options : https://bit.ly/4cE6A7S 📢 Must Watch Videos : - Run Test Class in VS Code : https://www.youtube.com/watch?v=6hf3UIZNf-g - API Basics : https://www.youtube.com/watch?v=l-bycEKSP2g - Salesforce Access Token in Postman : hhttps://www.youtube.com/watch?v=5wo42LUdo-o #VisualStudio #Salesforce #CodeFormatting #Prettier #SalesforceTutorial #Apex #ApexDevelopment #LWC #VSCode #SalesforceDeveloper #PrettierApex #VSCodeExtensions
Download
0 formatsNo download links available.