npm install --save-dev prettier-plugin-blade@^2 prettier prettier-plugin-tailwindcss
Created
September 24, 2024 05:11
-
-
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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node_modules | |
| dist | |
| .env* | |
| vendor/ | |
| /vendor | |
| public/ | |
| .git | |
| **/.git | |
| package-lock.json | |
| composer.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "printWidth": 120, | |
| "semi": true, | |
| "singleQuote": true, | |
| "tabWidth": 4, | |
| "trailingComma": "all", | |
| "plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"], | |
| "overrides": [ | |
| { | |
| "files": [ | |
| "*.blade.php" | |
| ], | |
| "options": { | |
| "parser": "blade" | |
| } | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // ... | |
| "scripts": { | |
| // ... | |
| "check": "npx prettier --check resources/", | |
| "format": "npx prettier --write resources/", | |
| } | |
| // ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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