From 79012ee897012efe1ec0e5e97adf203d18be89d4 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 4 Dec 2024 12:03:19 +0100 Subject: [PATCH] change blade formatter --- .../PrettierBlade/.blade.format.json | 75 +++++++++++++++++++ .../PrettierBlade/.prettierrc.json | 11 +-- .../PrettierBlade/PrettierBlade.php | 5 +- 3 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 src/Integrations/PrettierBlade/.blade.format.json diff --git a/src/Integrations/PrettierBlade/.blade.format.json b/src/Integrations/PrettierBlade/.blade.format.json new file mode 100644 index 0000000..594724f --- /dev/null +++ b/src/Integrations/PrettierBlade/.blade.format.json @@ -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" + ] +} diff --git a/src/Integrations/PrettierBlade/.prettierrc.json b/src/Integrations/PrettierBlade/.prettierrc.json index af3a8f3..4eb0589 100644 --- a/src/Integrations/PrettierBlade/.prettierrc.json +++ b/src/Integrations/PrettierBlade/.prettierrc.json @@ -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 @@ -15,9 +11,8 @@ ], "htmlWhitespaceSensitivity": "css", - "sortTailwindcssClasses": true, "singleAttributePerLine": true, "bracketSameLine": false, "printWidth": 600, "tabWidth": 4 - } +} diff --git a/src/Integrations/PrettierBlade/PrettierBlade.php b/src/Integrations/PrettierBlade/PrettierBlade.php index 8c83db4..45a1e43 100644 --- a/src/Integrations/PrettierBlade/PrettierBlade.php +++ b/src/Integrations/PrettierBlade/PrettierBlade.php @@ -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([