tythonco / sfdx-project-template

4 stars 1 forks source link

Add Prettier linting for Apex #8

Open ndrewr opened 4 years ago

ndrewr commented 4 years ago

Production ready:

https://github.com/dangmai/prettier-plugin-apex

and note this is recommended by SF themselves but with some special config to allow for longer build time of Apex:

https://developer.salesforce.com/tools/vscode/en/user-guide/prettier/

Apex Prettier runs slower than most other formatters. In some cases formatting will not succeed because VS Code will time out the operation after 500ms. In order to ensure Apex code has enough time to format your documents we recommend changing the VS Code settings as follows.

{
  "editor.formatOnSaveTimeout": 5000
}