Run npm install -D prettier prettier-plugin-antlers prettier-plugin-blade prettier-plugin-tailwindcss @prettier/plugin-php
in your terminal
Create a .prettierrc
file with the following content
{
"singleQuote": true,
"printWidth": 140,
"tabWidth": 4,
"plugins": ["prettier-plugin-antlers", "prettier-plugin-blade", "@prettier/plugin-php", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.antlers.html",
"options": {
"parser": "antlers",
"singleQuote": false
}
},
{
"files": ["**/*.php", "**/!*.blade.php"],
"options": {
"parser": "php",
"phpVersion": "8.2"
}
},
{
"files": "*.blade.php",
"options": {
"parser": "blade",
"singleQuote": false
}
},
{
"files": ["**/*.css", "**/*.html"],
"options": {
"singleQuote": false
}
}
]
}
Under Settings > Languages & Frameworks > JavaScript > Prettier
register the following pattern for Run for Files
:
{**/*,*}.{js,ts,jsx,tsx,html,vue,php,css}
- Make sure a Node interpreter is selected under
Settings > Language & Frameworks > Node.js