Skip to content

Commit

Permalink
Merge pull request #20 from media-code/enhancement/change-blade-forma…
Browse files Browse the repository at this point in the history
…tter

change blade formatter
  • Loading branch information
gwleuverink authored Dec 4, 2024
2 parents 9a80879 + 79012ee commit 1a60513
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 9 deletions.
75 changes: 75 additions & 0 deletions src/Integrations/PrettierBlade/.blade.format.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"useLaravelPint": true,
"formatJsAttributes": true,
"attributeJsOptions": {
"semi": false,
"printWidth": 800
},
"safeWrappingJsAttributes": [
"^x-data",
"^x-init"
],
"ignoreDirectives": [
"media",
"charset",
"import",
"namespace",
"supports",
"document",
"page",
"font-face",
"keyframes",
"viewport",
"counter-style",
"font-feature-values",
"swash",
"ornaments",
"annotation",
"stylistic",
"styleset",
"character-variant",
"font-variant-alternates",
"property",
"color-profile",
"click",
"submit",
"scroll",
"keydown",
"keypress",
"keyup",
"blur",
"change",
"contextmenu",
"copy",
"cut",
"paste",
"dblclick",
"drag",
"dragend",
"dragenter",
"dragleave",
"dragover",
"dragstart",
"drop",
"focus",
"focusin",
"focusout",
"input",
"mousedown",
"mouseenter",
"mouseleave",
"mousemove",
"mouseover",
"mouseout",
"mouseup",
"mousewheel",
"resize",
"select",
"touchcancel",
"touchend",
"touchmove",
"touchstart",
"wheel",
"verbatim"
]
}
11 changes: 3 additions & 8 deletions src/Integrations/PrettierBlade/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"plugins": [
"@shufo/prettier-plugin-blade"
],
"plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": [
"*.blade.php"
],
"files": ["*.blade.php"],
"options": {
"parser": "blade",
"tabWidth": 4
Expand All @@ -15,9 +11,8 @@
],

"htmlWhitespaceSensitivity": "css",
"sortTailwindcssClasses": true,
"singleAttributePerLine": true,
"bracketSameLine": false,
"printWidth": 600,
"tabWidth": 4
}
}
5 changes: 4 additions & 1 deletion src/Integrations/PrettierBlade/PrettierBlade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ public function __invoke()
$this
->npmInstallDev([
'prettier@^3',
'@shufo/prettier-plugin-blade',
'prettier-plugin-blade@^2',
'prettier-plugin-tailwindcss',
])
->npmUpdate([
'prettier',
'prettier-plugin-blade',
'prettier-plugin-tailwindcss',
])

->publishesConfigs([
'.prettierrc.json' => '.prettierrc.json',
'.blade.format.json' => '.blade.format.json',
])

->provideDusterLintConfig([
Expand Down

0 comments on commit 1a60513

Please sign in to comment.