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-c...
📌 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 : • Run Salesforce Apex Test Class in VS Code ...
API Basics : • API Basics - Inbound and Outbound APIs in ...
Salesforce Access Token in Postman : h • Automate Salesforce Authentication (Access...
#VisualStudio #Salesforce #CodeFormatting #Prettier #SalesforceTutorial #Apex #ApexDevelopment #LWC #VSCode #SalesforceDeveloper #PrettierApex #VSCodeExtensions
Auf dieser Seite können Sie das Online-Video Format Apex Code in VS Code using Prettier | Salesforce VS Code Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer That Salesforce Guy 18 August 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 4,723 Mal angesehen und es wurde von 54 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!