ematcher-prettier-module
v1.0.2
Published
e-Matcher prettier config for PHP 7.1, PHTML, JS, CSS, HTML
Readme
e-Matcher Prettier Config
Prettier npm configuration module used to format: PHP, HTML, CSS, JS and .phtml files.
Installation
Install the config module and Prettier (peer dependency):
Step 1:
npm install --save-dev ematcher-prettier-module prettierStep 2:
Set the module as the prettier configuration in package.json:
{
...
"prettier": "ematcher-prettier-module"
...
}Step 3:
Create a .prettierignore file in the project root to prevent formatting of unnecessary files:
vendor/
node_modules/
dist/
build/
files/
docs/
data/
composer.lock
package-lock.jsonStep 4:
Set prettier as the default formatter in PHPStorm:
- Go to Settings > Languages & Frameworks > Prettier
- Point it towards node_modules/prettier
- Set the Run for files to: {**/*,}*.{js,ts,jsx,tsx,css,scss,html,php,phtml}
- (Optional) Set to reformat on save
