Skip to content

Instantly share code, notes, and snippets.

@sprobejames
Created September 24, 2024 05:11
Show Gist options
  • Select an option

  • Save sprobejames/f6e2751bc8625df0c82fad1927ffc1e4 to your computer and use it in GitHub Desktop.

Select an option

Save sprobejames/f6e2751bc8625df0c82fad1927ffc1e4 to your computer and use it in GitHub Desktop.
How to set up Prettier On a Laravel App, Linting Tailwind Class Order and More see https://mattstauffer.com/blog/how-to-set-up-prettier-on-a-laravel-app-to-lint-tailwind-class-order-and-more/
node_modules
dist
.env*
vendor/
/vendor
public/
.git
**/.git
package-lock.json
composer.lock
{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": [
"*.blade.php"
],
"options": {
"parser": "blade"
}
}
]
}

Install Packages

npm install --save-dev prettier-plugin-blade@^2 prettier prettier-plugin-tailwindcss
{
// ...
"scripts": {
// ...
"check": "npx prettier --check resources/",
"format": "npx prettier --write resources/",
}
// ...
}
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[blade]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.documentSelectors": [
"**/*.blade.php"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment