André Amorim

Crafting Web Experiences

Home » My Notes » WordPress Block JS Code Standard (Prettier)

//

WordPress Block JS Code Standard (Prettier)

Installation

Install the module

$ npm install @wordpress/prettier-config –save-dev

Note: This package requires Node.js version with long-term support status (check Active LTS or Maintenance LTS releases). It is not compatible with older versions.

Usage

Add this to your package.json file:

“prettier”: “@wordpress/prettier-config”

Alternatively, add this to .prettierrc file:

“@wordpress/prettier-config”

Or add this to .prettierrc.js file:

module.exports = require( ‘@wordpress/prettier-config’ );


Published date:

Modified date: