Prettier Plugin: PHPDoc

A prettier plugin that formats PHPDoc and the types used in them.

Installation

npm install --save-dev prettier-plugin-phpdoc

Usage

Add to Prettier Config

module.exports = {
	plugins: ['./node_modules/prettier-plugin-phpdoc/dist/index.js'],
};

Options

  • wrapText: (default: false) Whether to wrap text in PHPDoc after it crosses printWidth
  • expandNull: (default: false) Whether to expand ?int (and other types) to null|int