JSPM

  • Created
  • Published
  • Downloads 385
  • Score
    100M100P100Q109558F
  • License Apache-2.0

A Salesforce CLI plugin containing a hook that uses prettier to format Salesforce metadata source files retrieved or pulled from Salesforce orgs.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jayree/sfdx-plugin-prettier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @jayree/sfdx-plugin-prettier

    A Salesforce CLI plugin containing a hook that uses prettier to format Salesforce metadata source files retrieved or pulled from Salesforce orgs.

    sfdx Version test-and-release Downloads/week License

    sfdx-plugin-prettier is an sfdx plugin to format Salesforce metadata source files. It is triggered by the postsourceupdate hook after running force:source:retrieve or force:source:pull.

    Install

    $ npm install -g @jayree/sfdx-plugin-prettier
    $ sfdx COMMAND
    running command...
    $ sfdx (--version)
    @jayree/sfdx-plugin-prettier/1.3.147 linux-x64 node-v24.12.0
    $ sfdx --help [COMMAND]
    USAGE
      $ sfdx COMMAND
    ...

    Usage

    Use force:source:retrieve or force:source:pull to tirgger the hook. The formatting is performed on the retrieved source files.

    Configuration and Ignore Files

    sfdx-plugin-prettier uses the .prettierrc, .prettierignore, and .editorconfig files in the sfdx project folder.

    When the hook is executed for the first time, a sfdx-plugin-prettier setting is added to the sfdx-project.json file. Here you can enable or disable the hook by setting enabled to true or false (default). If you want the hook to remain disabled for a project, you can remove the setting again.

    {
      "plugins": {
        "sfdx-plugin-prettier": {
          "enabled": true
        }
      }
    }