🆙 Add cms i using 🆙

This commit is contained in:
Remco
2025-11-25 22:42:56 +01:00
parent 94704e0925
commit d44196149e
35591 changed files with 3601123 additions and 0 deletions
@@ -0,0 +1,731 @@
# Changelog
## [1.8.12](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.11...v1.8.12) (2023-04-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.12 ([47f4366](https://github.com/shufo/prettier-plugin-blade/commit/47f43666e2c4a35086d5308faee8fa262551b6cc))
* **deps:** update actions/stale action to v8 ([b275361](https://github.com/shufo/prettier-plugin-blade/commit/b275361a63a82afa8e14c4c5c9d9e0b39c7d202d))
## [1.8.11](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.10...v1.8.11) (2023-03-22)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.10 ([5a4491e](https://github.com/shufo/prettier-plugin-blade/commit/5a4491ed8571dca25df8a6a830ca32f5dcf12479))
* **deps:** update dependency typescript to v5 ([33d36f5](https://github.com/shufo/prettier-plugin-blade/commit/33d36f59400ded3172c3c5086815a417f61fc6c6))
## [1.8.10](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.9...v1.8.10) (2023-02-25)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.9 ([ed9c628](https://github.com/shufo/prettier-plugin-blade/commit/ed9c628c65a3027099e13f509ab6d2adc64ac235))
## [1.8.9](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.8...v1.8.9) (2023-02-23)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.8 ([2ef11ba](https://github.com/shufo/prettier-plugin-blade/commit/2ef11bade4d1797e629943740735a732bbfd26f0))
## [1.8.8](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.7...v1.8.8) (2023-02-12)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.7 ([b647e2c](https://github.com/shufo/prettier-plugin-blade/commit/b647e2c20bf10e694e98c3442b1025eacf8c7676))
## [1.8.7](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.6...v1.8.7) (2023-02-05)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.6 ([93946eb](https://github.com/shufo/prettier-plugin-blade/commit/93946eb6b05a45215480b21aa0cbb94725143a5b))
* **deps:** bump synckit from 0.8.4 to 0.8.5 ([b59e641](https://github.com/shufo/prettier-plugin-blade/commit/b59e641619e233def9e2a379d7213ef524cb26ca))
## [1.8.6](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.5...v1.8.6) (2023-01-20)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.5 ([d8c9ea4](https://github.com/shufo/prettier-plugin-blade/commit/d8c9ea41599e67b771895fa20b067e53d89c94ae))
## [1.8.5](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.4...v1.8.5) (2023-01-14)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.4 ([97a17f4](https://github.com/shufo/prettier-plugin-blade/commit/97a17f49d83fe6d41c00a154824416ed426020db))
* **deps:** bump json5 from 2.2.0 to 2.2.3 ([ed3b9ba](https://github.com/shufo/prettier-plugin-blade/commit/ed3b9ba4629c1570f0600ae729717d56c142a9d4))
* **deps:** update dependency esbuild to ^0.17.0 ([2f88a14](https://github.com/shufo/prettier-plugin-blade/commit/2f88a1439d16375e98fddfcd00a952a304dc2be6))
## [1.8.4](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.3...v1.8.4) (2023-01-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.3 ([1cc5049](https://github.com/shufo/prettier-plugin-blade/commit/1cc504921fd55b5ab536110202bd5338803fb5ad))
## [1.8.3](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.2...v1.8.3) (2022-12-25)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.2 ([7900d40](https://github.com/shufo/prettier-plugin-blade/commit/7900d40f8874e38618b834206e42b4091ffaf92c))
* **deps:** update actions/stale action to v7 ([da64151](https://github.com/shufo/prettier-plugin-blade/commit/da6415129a0aa97f4e04715d32a8c87907d9cebd))
## [1.8.2](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.1...v1.8.2) (2022-12-18)
### Miscellaneous
* 🤖 bump blade-formatter to 1.32.0 ([e4e843a](https://github.com/shufo/prettier-plugin-blade/commit/e4e843a525f19023e3f66fa52cecfe6f1e8575c8))
* 🤖 bump blade-formatter to 1.32.1 ([efb2e1c](https://github.com/shufo/prettier-plugin-blade/commit/efb2e1cde2da721b03ad0fc47636e6428338951c))
* **deps:** update cirrus-actions/rebase action to v1.8 ([ab1549d](https://github.com/shufo/prettier-plugin-blade/commit/ab1549def434e1a5956337f42947a87e6ccac67e))
* **deps:** update dependency esbuild to ^0.16.0 ([6391e5e](https://github.com/shufo/prettier-plugin-blade/commit/6391e5edffd3fc8bea4ae5b27e2180aec4aa780c))
## [1.8.1](https://github.com/shufo/prettier-plugin-blade/compare/v1.8.0...v1.8.1) (2022-11-20)
### Miscellaneous
* 🤖 bump blade-formatter to 1.31.1 ([9d252db](https://github.com/shufo/prettier-plugin-blade/commit/9d252db53040d6e279a8ae5c7612dc806907453d))
## [1.8.0](https://github.com/shufo/prettier-plugin-blade/compare/v1.7.3...v1.8.0) (2022-10-30)
### Features
* 🎸 add option `--custom-html-attributes-order` ([97070f7](https://github.com/shufo/prettier-plugin-blade/commit/97070f7754ef102481446477440bdbf895e21375))
### Miscellaneous
* 🤖 bump blade-formatter to 1.31.0 ([32291f6](https://github.com/shufo/prettier-plugin-blade/commit/32291f6b3aafdc2b01fc994aa7bf26bc915ec426))
## [1.7.3](https://github.com/shufo/prettier-plugin-blade/compare/v1.7.2...v1.7.3) (2022-10-23)
### Miscellaneous
* 🤖 bump blade-formatter to 1.30.3 ([e6ce278](https://github.com/shufo/prettier-plugin-blade/commit/e6ce2786b20d3d3dc73978edd965824c4965bb62))
## [1.7.2](https://github.com/shufo/prettier-plugin-blade/compare/v1.7.1...v1.7.2) (2022-10-16)
### Miscellaneous
* 🤖 bump blade-formatter to 1.30.2 ([7bf0057](https://github.com/shufo/prettier-plugin-blade/commit/7bf00579df1531732d9cf5431f8fefb58e07a20e))
* **deps:** update pozil/auto-assign-issue action to v1.11.0 ([f483a27](https://github.com/shufo/prettier-plugin-blade/commit/f483a27fdc03b54c492f9d864c10720c3ba1fb89))
## [1.7.1](https://github.com/shufo/prettier-plugin-blade/compare/v1.7.0...v1.7.1) (2022-10-10)
### Miscellaneous
* 🤖 bump blade-formatter to 1.30.1 ([b0c96cd](https://github.com/shufo/prettier-plugin-blade/commit/b0c96cd1e6aa096cdb0cfc23187edb7735a6f28c))
## [1.7.0](https://github.com/shufo/prettier-plugin-blade/compare/v1.6.3...v1.7.0) (2022-10-09)
### Features
* 🎸 add option `--no-php-syntax-check` ([f710459](https://github.com/shufo/prettier-plugin-blade/commit/f7104593c4316d8ca7742b74c516fc3611e26536))
### Miscellaneous
* 🤖 bump blade-formatter to 1.30.0 ([6bf2b50](https://github.com/shufo/prettier-plugin-blade/commit/6bf2b50ec622574f378855a5826c48a670538275))
* **deps:** update pozil/auto-assign-issue action to v1.10.1 ([7775bdb](https://github.com/shufo/prettier-plugin-blade/commit/7775bdb0541d656ddd26b3932401d5e33ff5abc3))
## [1.6.3](https://github.com/shufo/prettier-plugin-blade/compare/v1.6.2...v1.6.3) (2022-10-01)
### Miscellaneous
* 🤖 bump blade-formatter to 1.29.8 ([1c9152e](https://github.com/shufo/prettier-plugin-blade/commit/1c9152e71cf3ac912c3dc3adc9e7dbe16a1e7539))
## [1.6.2](https://github.com/shufo/prettier-plugin-blade/compare/v1.6.1...v1.6.2) (2022-09-24)
### Miscellaneous
* 🤖 bump blade-formatter to 1.29.7 ([ac6d4c8](https://github.com/shufo/prettier-plugin-blade/commit/ac6d4c8eff19a7f1db59b785b42b1d2be337a936))
## [1.6.1](https://github.com/shufo/prettier-plugin-blade/compare/v1.6.0...v1.6.1) (2022-09-21)
### Miscellaneous
* 🤖 bump blade-formatter to 1.29.5 ([83e1e61](https://github.com/shufo/prettier-plugin-blade/commit/83e1e6163fcf10ea2c1cd9a5bb20d85b41427c92))
## [1.6.0](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.7...v1.6.0) (2022-09-19)
### Features
* 🎸 add option `--tailwindcss-config-path` ([d27adcc](https://github.com/shufo/prettier-plugin-blade/commit/d27adcc1d90c57461bfe3b12727613720aa364aa))
### Miscellaneous
* 🤖 add concat-stream to dev-dependencies ([b23cef4](https://github.com/shufo/prettier-plugin-blade/commit/b23cef4ec4849769298efb9c85fbe88fbeb6c68d))
* 🤖 bump blade-formatter to 1.29.0 ([27ccc95](https://github.com/shufo/prettier-plugin-blade/commit/27ccc9546ae1eb60d8bcebbd7aeeb9f565e54cb4))
* 🤖 bump blade-formatter to 1.29.2 ([9c713b2](https://github.com/shufo/prettier-plugin-blade/commit/9c713b2e84c50f716148bc1c4bf90ddeaafcf0f3))
### Fixes
* 🐛 config path is not calculated relative to .prettierrc ([0f7d959](https://github.com/shufo/prettier-plugin-blade/commit/0f7d959235ae5ef09eb9ddd3d5ff697165b8affa))
* 🐛 support for cases where prettierrc.json needs lookup ([84d2b66](https://github.com/shufo/prettier-plugin-blade/commit/84d2b66709cff9092d5abe0bffc01fbd50e51a32))
## [1.5.7](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.6...v1.5.7) (2022-09-11)
### Miscellaneous
* 🤖 bump blade-formatter to 1.28.0 ([1393f3f](https://github.com/shufo/prettier-plugin-blade/commit/1393f3f6dbf90c87586b4ee4343d6201afa1f53a))
* **deps:** update dependency ts-jest to v29 ([c5a9f99](https://github.com/shufo/prettier-plugin-blade/commit/c5a9f991ec10652145cef5eb20d0d164d663b12d))
## [1.5.6](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.5...v1.5.6) (2022-09-03)
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.7 ([993aed8](https://github.com/shufo/prettier-plugin-blade/commit/993aed84c339dbd92f253e4f92f4f135543f0d87))
* **deps:** bump synckit from 0.8.3 to 0.8.4 ([59974b2](https://github.com/shufo/prettier-plugin-blade/commit/59974b289d3c7941b9149067a986b12d126c424c))
## [1.5.5](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.4...v1.5.5) (2022-08-28)
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.6 ([59ecd46](https://github.com/shufo/prettier-plugin-blade/commit/59ecd46e83c3c19c3b101e277a12fa318cebcb70))
* **deps:** update dependency jest to v29 ([fa92c70](https://github.com/shufo/prettier-plugin-blade/commit/fa92c70f1d949e4e2ba7e9f2c9574981de1afc7d))
## [1.5.4](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.3...v1.5.4) (2022-08-22)
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.5 ([bae10a7](https://github.com/shufo/prettier-plugin-blade/commit/bae10a7b69f6f39aec3bc9c47d3bc12d019ce2d5))
* **deps:** bump synckit from 0.8.1 to 0.8.3 ([3659513](https://github.com/shufo/prettier-plugin-blade/commit/365951323cec9f6112ecb1ffcdc87cd248ab33f2))
* **deps:** update pozil/auto-assign-issue action to v1.10.0 ([40a5376](https://github.com/shufo/prettier-plugin-blade/commit/40a53762fcabcc5b2fa9b16ba22803e136946b5b))
## [1.5.3](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.2...v1.5.3) (2022-08-13)
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.4 ([ca2d496](https://github.com/shufo/prettier-plugin-blade/commit/ca2d496514ac16d8c35adf343cb3d1818ba345f0))
* **deps:** update dependency esbuild to ^0.15.0 ([2730657](https://github.com/shufo/prettier-plugin-blade/commit/2730657225e21ada594855bf830b0cb01fcf7e7b))
## [1.5.2](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.1...v1.5.2) (2022-08-09)
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.2 ([801858b](https://github.com/shufo/prettier-plugin-blade/commit/801858bea4c5194a094187b67ad5109d4f765ec1))
## [1.5.1](https://github.com/shufo/prettier-plugin-blade/compare/v1.5.0...v1.5.1) (2022-08-08)
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.1 ([1009ca0](https://github.com/shufo/prettier-plugin-blade/commit/1009ca0de2da88e870e7382aad1c24e38b09e05b))
## [1.5.0](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.22...v1.5.0) (2022-08-08)
### Features
* 🎸 sort html attributes option ([e43c6e2](https://github.com/shufo/prettier-plugin-blade/commit/e43c6e2f2e5dcb7ab431cb90c647ea18aae36168))
### Miscellaneous
* 🤖 bump blade-formatter to 1.27.0 ([c00a43e](https://github.com/shufo/prettier-plugin-blade/commit/c00a43e5a469659a0de035e5aa22e4da642f64ac))
* **deps:** update akhilmhdh/contributors-readme-action action to v2.3.5 ([4e713ad](https://github.com/shufo/prettier-plugin-blade/commit/4e713adf11e2f39b42c21a8b599a0adceda21a82))
* **deps:** update akhilmhdh/contributors-readme-action action to v2.3.6 ([8f4c5b1](https://github.com/shufo/prettier-plugin-blade/commit/8f4c5b11383b9a67c89cbf881d8fa82f530201a1))
* **deps:** update pozil/auto-assign-issue action to v1.9.0 ([e012784](https://github.com/shufo/prettier-plugin-blade/commit/e01278439a4f530217c2a40cd43897bf15b0b3f9))
### Fixes
* 🐛 support prettier's no multiple empty lines behaviour ([fb64b85](https://github.com/shufo/prettier-plugin-blade/commit/fb64b85f14eedeb4552929a3f70115c551b09b00))
## [1.4.22](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.21...v1.4.22) (2022-07-31)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.17 ([5108a3c](https://github.com/shufo/prettier-plugin-blade/commit/5108a3ce70733df1895da114a5baed2c47c446b4))
## [1.4.21](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.20...v1.4.21) (2022-07-28)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.16 ([c4b9d54](https://github.com/shufo/prettier-plugin-blade/commit/c4b9d54fe66f0bbd47cec56defa7fd3605f93e45))
## [1.4.20](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.19...v1.4.20) (2022-07-26)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.15 ([af175df](https://github.com/shufo/prettier-plugin-blade/commit/af175df773c662d98fe468ed1e205699e7de75c8))
## [1.4.19](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.18...v1.4.19) (2022-07-20)
### Fixes
* **deps:** update dependency synckit to ^0.8.0 ([bf488b0](https://github.com/shufo/prettier-plugin-blade/commit/bf488b088a625933e2021c1f151b3cb03e783d58))
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.14 ([bf6a34d](https://github.com/shufo/prettier-plugin-blade/commit/bf6a34d8b4e32ed0b54bcd2b745f6d17a9556d8c))
* **deps:** bump synckit from 0.8.0 to 0.8.1 ([b262b5b](https://github.com/shufo/prettier-plugin-blade/commit/b262b5bb0ba55c121c02568e0baabba9e9dc90c0))
* **deps:** update pozil/auto-assign-issue action to v1.8.0 ([f781f24](https://github.com/shufo/prettier-plugin-blade/commit/f781f24bec9588ed71c0952bdafc3394d2041adb))
## [1.4.18](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.17...v1.4.18) (2022-07-12)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.13 ([df90dc9](https://github.com/shufo/prettier-plugin-blade/commit/df90dc978899d1dc83a4c67314a58d2961652e9b))
## [1.4.17](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.16...v1.4.17) (2022-07-06)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.12 ([a4bb6b8](https://github.com/shufo/prettier-plugin-blade/commit/a4bb6b861c032ff7b32d5254248c5bdbcbced794))
* **deps:** bump synckit from 0.7.1 to 0.7.2 ([79fa3e1](https://github.com/shufo/prettier-plugin-blade/commit/79fa3e1d4e6e9f45411a1da448afab0ca894c9d4))
## [1.4.16](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.15...v1.4.16) (2022-07-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.11 ([042a75d](https://github.com/shufo/prettier-plugin-blade/commit/042a75dd530f80532a57e1c50753d32dad03278d))
* **deps-dev:** bump @typescript-eslint/parser from 5.10.1 to 5.11.0 ([4198cfc](https://github.com/shufo/prettier-plugin-blade/commit/4198cfc4902b21853ec362846bd4f53fc17f14fe))
* **deps:** update pozil/auto-assign-issue action to v1.7.3 ([8a4aabc](https://github.com/shufo/prettier-plugin-blade/commit/8a4aabc062a03cbbae2916923930748885d2c4d0))
## [1.4.15](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.14...v1.4.15) (2022-06-21)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.10 ([263a12c](https://github.com/shufo/prettier-plugin-blade/commit/263a12ca6a2ed573b4d909b4357fed042d2228d5))
## [1.4.14](https://github.com/shufo/prettier-plugin-blade/compare/v1.4.13...v1.4.14) (2022-06-19)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.9 ([2361324](https://github.com/shufo/prettier-plugin-blade/commit/236132443702b909d5a7aa0e085e434a45601fca))
* **deps:** update actions/cache action to v3 ([307d33e](https://github.com/shufo/prettier-plugin-blade/commit/307d33e28e49bc7fa318460537a33db5af0a0a8d))
* **deps:** update actions/checkout action to v3 ([6c69006](https://github.com/shufo/prettier-plugin-blade/commit/6c69006b8107a12f3483490295bc162e4a0f8101))
* **deps:** update actions/setup-node action to v3 ([12b6415](https://github.com/shufo/prettier-plugin-blade/commit/12b6415dcc7035ae8f8f6d5e39c8d54dd297835b))
* **deps:** update cirrus-actions/rebase action to v1.7 ([5da5d80](https://github.com/shufo/prettier-plugin-blade/commit/5da5d809816262cec9b6b7241ad4e5d1a78fcf3e))
* **deps:** update codecov/codecov-action action to v3 ([694f668](https://github.com/shufo/prettier-plugin-blade/commit/694f66861b4b1e5891317e3a25a79a1ebbf7e635))
* **deps:** update googlecloudplatform/release-please-action action to v3 ([4d2db4a](https://github.com/shufo/prettier-plugin-blade/commit/4d2db4a9c1286b3c5e4f18f269c595035f624465))
* **deps:** update jest monorepo to v28 ([edc4174](https://github.com/shufo/prettier-plugin-blade/commit/edc4174e3acb79a9cc94f3bfae7bf6522f850a83))
* **deps:** update pozil/auto-assign-issue action to v1.7.0 ([5bb7c0a](https://github.com/shufo/prettier-plugin-blade/commit/5bb7c0a795b934264d7ec1043e172f857d3764ad))
### [1.4.13](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.12...v1.4.13) (2022-06-18)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.8 ([8549777](https://www.github.com/shufo/prettier-plugin-blade/commit/8549777a1dbfa90ab8d46fd1c5a8d14473b0efd6))
### [1.4.12](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.11...v1.4.12) (2022-06-15)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.7 ([e197db9](https://www.github.com/shufo/prettier-plugin-blade/commit/e197db9a7d16a7055bf7792f7c87bea627b43fec))
### [1.4.11](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.10...v1.4.11) (2022-06-10)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.6 ([65c3d81](https://www.github.com/shufo/prettier-plugin-blade/commit/65c3d817323d270644b2f30974ed62c05b13c6c1))
### [1.4.10](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.9...v1.4.10) (2022-06-05)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.5 ([9a48202](https://www.github.com/shufo/prettier-plugin-blade/commit/9a48202d09f3ab476449f43a1e9d711b0fe985b3))
### [1.4.9](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.8...v1.4.9) (2022-06-05)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.4 ([df62766](https://www.github.com/shufo/prettier-plugin-blade/commit/df62766699c3b8db43a7482203afadffabb15921))
### [1.4.8](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.7...v1.4.8) (2022-06-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.3 ([b32ab07](https://www.github.com/shufo/prettier-plugin-blade/commit/b32ab070c3f5f47b45922c9d866255600581810c))
### [1.4.7](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.6...v1.4.7) (2022-06-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.2 ([8f7d75f](https://www.github.com/shufo/prettier-plugin-blade/commit/8f7d75f94076f9e720800677afd8f9be86264d6a))
### [1.4.6](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.5...v1.4.6) (2022-05-21)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.1 ([71c4d1c](https://www.github.com/shufo/prettier-plugin-blade/commit/71c4d1c47d01d891cec84eb3dfb52a217bd24085))
* **deps:** bump minimist from 1.2.5 to 1.2.6 ([fe3714f](https://www.github.com/shufo/prettier-plugin-blade/commit/fe3714ff45d27bb1e26d1ff0f55d71d35242481a))
### [1.4.5](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.4...v1.4.5) (2022-05-19)
### Miscellaneous
* 🤖 bump blade-formatter to 1.26.0 ([85a7784](https://www.github.com/shufo/prettier-plugin-blade/commit/85a77842246dd67c7bd02418530e83c557bc3782))
### [1.4.4](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.3...v1.4.4) (2022-05-17)
### Miscellaneous
* 🤖 bump blade-formatter to 1.25.4 ([b7ebc16](https://www.github.com/shufo/prettier-plugin-blade/commit/b7ebc1672b86474a53306104b030c30c02e6f478))
### [1.4.3](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.2...v1.4.3) (2022-05-15)
### Miscellaneous
* 🤖 bump blade-formatter to 1.25.3 ([2f613ef](https://www.github.com/shufo/prettier-plugin-blade/commit/2f613efde99e91a3ee0d9d0965a7cb81530ee5f6))
### [1.4.2](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.1...v1.4.2) (2022-05-14)
### Miscellaneous
* 🤖 bump blade-formatter to 1.25.2 ([3e2b965](https://www.github.com/shufo/prettier-plugin-blade/commit/3e2b965b05f0609a72e6ec51b38bad51e2f4364c))
### [1.4.1](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.4.0...v1.4.1) (2022-05-13)
### Miscellaneous
* 🤖 bump blade-formatter to 1.25.1 ([7e5367f](https://www.github.com/shufo/prettier-plugin-blade/commit/7e5367f01c979c2fc7753e922184a0f4d27187b3))
## [1.4.0](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.6...v1.4.0) (2022-05-12)
### Miscellaneous
* 🤖 bump blade-formatter to 1.25.0 ([8428d7e](https://www.github.com/shufo/prettier-plugin-blade/commit/8428d7ee7961bcafdab8547d522cb1c050fbd83f))
* **deps-dev:** bump eslint from 8.7.0 to 8.8.0 ([ad58451](https://www.github.com/shufo/prettier-plugin-blade/commit/ad58451204cd6730f689bc1d26c5e8b721292481))
* **deps:** bump synckit from 0.7.0 to 0.7.1 ([716fe36](https://www.github.com/shufo/prettier-plugin-blade/commit/716fe36de48aaba70dca692cf94ef519e682ce81))
* release 1.4.0 ([8626c24](https://www.github.com/shufo/prettier-plugin-blade/commit/8626c2414bf7da28fc8dff58dda2594d40276fde))
### [1.3.6](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.5...v1.3.6) (2022-05-07)
### Miscellaneous
* 🤖 bump blade-formatter to 1.24.0 ([15009f1](https://www.github.com/shufo/prettier-plugin-blade/commit/15009f1881182eecbac3f281394527b3c553c91a))
### [1.3.5](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.4...v1.3.5) (2022-05-03)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.8 ([d685346](https://www.github.com/shufo/prettier-plugin-blade/commit/d685346430a401df066508dc810cd23e011e1a03))
### [1.3.4](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.3...v1.3.4) (2022-05-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.7 ([824b514](https://www.github.com/shufo/prettier-plugin-blade/commit/824b514efe8d7230ff6a9d281369f66bf10311b7))
### [1.3.3](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.2...v1.3.3) (2022-05-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.6 ([6c64436](https://www.github.com/shufo/prettier-plugin-blade/commit/6c6443655510ac6a931b7966e7905ee5fe0efb8a))
### [1.3.2](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.1...v1.3.2) (2022-04-27)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.5 ([49c0940](https://www.github.com/shufo/prettier-plugin-blade/commit/49c09401ce86957cddeb345b8a9c1f76b47b25c4))
### [1.3.1](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.3.0...v1.3.1) (2022-04-25)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.3 ([abd2961](https://www.github.com/shufo/prettier-plugin-blade/commit/abd29612e9e26c3922a043376e18369ee92e9cd5))
## [1.3.0](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.6...v1.3.0) (2022-04-24)
### Features
* 🎸 bracketSameLine option ([6b89032](https://www.github.com/shufo/prettier-plugin-blade/commit/6b89032f18641785547d9c74b36d5e0bdde4f535))
### [1.2.6](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.5...v1.2.6) (2022-04-17)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.2 ([8984d04](https://www.github.com/shufo/prettier-plugin-blade/commit/8984d049c67a80c4a8a491669604313032279c94))
* **deps:** bump prettier from 2.6.1 to 2.6.2 ([55a7f08](https://www.github.com/shufo/prettier-plugin-blade/commit/55a7f088dedc6f9bfd120232465c2654c5950ad3))
### [1.2.5](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.4...v1.2.5) (2022-04-15)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.1 ([197a226](https://www.github.com/shufo/prettier-plugin-blade/commit/197a22675444c577542abdb9425b42cc66ac2043))
* **deps:** bump synckit from 0.6.0 to 0.7.0 ([ea8407f](https://www.github.com/shufo/prettier-plugin-blade/commit/ea8407f3e5c2f5c21272959bd403ae5c262a43e5))
### [1.2.4](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.3...v1.2.4) (2022-04-03)
### Miscellaneous
* 🤖 bump blade-formatter to 1.23.0 ([34768aa](https://www.github.com/shufo/prettier-plugin-blade/commit/34768aa6716d1d3a399dcbc478b6203734091cb2))
### [1.2.3](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.2...v1.2.3) (2022-04-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.22.3 ([79304a0](https://www.github.com/shufo/prettier-plugin-blade/commit/79304a0e4c59b6b0f13f96d86ff36bf29ba8e28d))
### [1.2.2](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.1...v1.2.2) (2022-03-29)
### Miscellaneous
* 🤖 bump blade-formatter to 1.22.2 ([6ce7e41](https://www.github.com/shufo/prettier-plugin-blade/commit/6ce7e41f10c58f0eec027968ea4c38539c8daf12))
* **deps:** bump prettier from 2.6.0 to 2.6.1 ([6788dad](https://www.github.com/shufo/prettier-plugin-blade/commit/6788dad7bb22de016557abb7c379b5ac5265476e))
### [1.2.1](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.2.0...v1.2.1) (2022-03-25)
### Miscellaneous
* 🤖 bump blade-formatter to 1.22.1 ([02efc64](https://www.github.com/shufo/prettier-plugin-blade/commit/02efc64fef77624c26620f567c2145438a516556))
## [1.2.0](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.11...v1.2.0) (2022-03-25)
### Features
* 🎸 singleAttributePerLine option ([993cf77](https://www.github.com/shufo/prettier-plugin-blade/commit/993cf777e07cc5bfedf48137100b3aaa87961a37))
### Miscellaneous
* 🤖 bump @types/prettier to 2.4.4 ([d214534](https://www.github.com/shufo/prettier-plugin-blade/commit/d21453485aaae1222b67a53e40e5e98411bfaac2))
### [1.1.11](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.10...v1.1.11) (2022-03-23)
### Miscellaneous
* 🤖 bump blade-formatter to 1.22.0 ([ef7e258](https://www.github.com/shufo/prettier-plugin-blade/commit/ef7e258a17cf166c82e5b49df27905d24cf76e15))
### [1.1.10](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.9...v1.1.10) (2022-03-19)
### Miscellaneous
* 🤖 bump blade-formatter to 1.21.5 ([9b5e230](https://www.github.com/shufo/prettier-plugin-blade/commit/9b5e230b39b9293e128466b7c5884595f58e4f70))
### [1.1.9](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.8...v1.1.9) (2022-03-18)
### Miscellaneous
* 🤖 bump blade-formatter to 1.21.4 ([ee04321](https://www.github.com/shufo/prettier-plugin-blade/commit/ee0432116da6c68cf12534d00ed44e5fd00ae531))
### [1.1.8](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.7...v1.1.8) (2022-03-14)
### Miscellaneous
* 🤖 bump blade-formatter to 1.21.3 ([ed62c2c](https://www.github.com/shufo/prettier-plugin-blade/commit/ed62c2c26796307d7fdbca294901843c4ee89845))
### [1.1.7](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.6...v1.1.7) (2022-03-13)
### Miscellaneous
* 🤖 bump blade-formatter to 1.21.2 ([5a518e1](https://www.github.com/shufo/prettier-plugin-blade/commit/5a518e11fd705baae30e7aca736d7d7e4d320bac))
### [1.1.6](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.5...v1.1.6) (2022-03-12)
### Miscellaneous
* 🤖 bump blade-formatter to 1.21.1 ([4aa52ab](https://www.github.com/shufo/prettier-plugin-blade/commit/4aa52ab514ab50cf24ad2c9520a1908f1dee691a))
### [1.1.5](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.4...v1.1.5) (2022-03-09)
### Miscellaneous
* 🤖 bump blade-formatter to 1.21.0 ([dcd4fd0](https://www.github.com/shufo/prettier-plugin-blade/commit/dcd4fd0a180134f964f7de95f139a1179de9b136))
### [1.1.4](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.3...v1.1.4) (2022-03-05)
### Miscellaneous
* 🤖 bump blade-formatter to 1.20.5 ([c44cd9e](https://www.github.com/shufo/prettier-plugin-blade/commit/c44cd9e60dc6de52c9e008ad4ec0e4cb14ae0861))
### [1.1.3](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.2...v1.1.3) (2022-03-03)
### Miscellaneous
* 🤖 bump blade-formatter to 1.20.4 ([0817eab](https://www.github.com/shufo/prettier-plugin-blade/commit/0817eab5afd18329e4afea4cac6d2879ce4077d3))
### [1.1.2](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.1...v1.1.2) (2022-03-03)
### Miscellaneous
* 🤖 bump blade-formatter to 1.20.3 ([a1012c3](https://www.github.com/shufo/prettier-plugin-blade/commit/a1012c3bfb87fd503d5fd22e93b96973a094c0d7))
### [1.1.1](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.1.0...v1.1.1) (2022-03-02)
### Miscellaneous
* 🤖 bump blade-formatter to 1.20.2 ([49230ee](https://www.github.com/shufo/prettier-plugin-blade/commit/49230ee37ecc806afe9391c52a8a93870af1d642))
## [1.1.0](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.11...v1.1.0) (2022-02-27)
### Features
* 🎸 add automatic Tailwind Css class sorting option ([87a2a1f](https://www.github.com/shufo/prettier-plugin-blade/commit/87a2a1f3a6bd363c37ebbc91dedccbb9e12628e0))
### Miscellaneous
* 🤖 bump blade-formatter to 1.20.1 ([f02df0b](https://www.github.com/shufo/prettier-plugin-blade/commit/f02df0bb1181a0bda96970c6501a2ffd23c331d2))
* 🤖 enable tailwindcss class sort behaviour by default ([6608c9e](https://www.github.com/shufo/prettier-plugin-blade/commit/6608c9eed713ab4b73e811de734d7d56942808ca))
### [1.0.11](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.10...v1.0.11) (2022-02-23)
### Miscellaneous
* 🤖 bump blade-formatter to 1.19.0 ([505da42](https://www.github.com/shufo/prettier-plugin-blade/commit/505da42362e952ce40c63f93311cac7110fa125f))
### [1.0.10](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.9...v1.0.10) (2022-02-21)
### Miscellaneous
* 🤖 bump blade-formatter to 1.18.6 ([6db527d](https://www.github.com/shufo/prettier-plugin-blade/commit/6db527d3b19f78a42009b502370f773282286937))
### [1.0.9](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.8...v1.0.9) (2022-02-20)
### Miscellaneous
* 🤖 bump blade-formatter to 1.18.5 ([d90be2f](https://www.github.com/shufo/prettier-plugin-blade/commit/d90be2f37d0aa06aac89cfc61a132f2135b201f8))
### [1.0.8](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.7...v1.0.8) (2022-02-13)
### Miscellaneous
* 🤖 bump blade-formatter to 1.18.4 ([0482f97](https://www.github.com/shufo/prettier-plugin-blade/commit/0482f9798ace408db600fca315c51079351252b8))
### [1.0.7](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.6...v1.0.7) (2022-02-13)
### Miscellaneous
* 🤖 bump blade-formatter to 1.18.3 ([0dd52fd](https://www.github.com/shufo/prettier-plugin-blade/commit/0dd52fd31846d13dc6c3aa0a63eda8dc46ab0e0b))
### [1.0.6](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.5...v1.0.6) (2022-02-09)
### Miscellaneous
* 🤖 bump blade-formatter to 1.17.5 ([363e74d](https://www.github.com/shufo/prettier-plugin-blade/commit/363e74dc2617f3fa6f2214d4885935e65b9d1eff))
### [1.0.5](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.4...v1.0.5) (2022-02-08)
### Miscellaneous
* 🤖 bump blade-formatter to 1.17.4 ([8343867](https://www.github.com/shufo/prettier-plugin-blade/commit/83438670be7c7faa68c227442eb6ae67e74d7473))
### [1.0.4](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.3...v1.0.4) (2022-02-06)
### Miscellaneous
* 🤖 add codecov to dev-dependencies ([9c247ed](https://www.github.com/shufo/prettier-plugin-blade/commit/9c247edfe8569a842d7bc1e5769f02acde40fbad))
* 🤖 add ignore pattern ([982483b](https://www.github.com/shufo/prettier-plugin-blade/commit/982483bdfca20eec56e6476767458151e89691b9))
* 🤖 bump blade-formatter to 1.17.3 ([e82c73e](https://www.github.com/shufo/prettier-plugin-blade/commit/e82c73e6395a50c714e1b5e1114a7d049573eff0))
### [1.0.3](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.2...v1.0.3) (2022-01-29)
### Miscellaneous
* 🤖 bump blade-formatter to 1.17.2 ([cd6522e](https://www.github.com/shufo/prettier-plugin-blade/commit/cd6522e33051cbf51743b1836e77c0a0f75f0f29))
### [1.0.2](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.1...v1.0.2) (2022-01-27)
### Miscellaneous
* 🤖 add synckit to dependencies ([9515a19](https://www.github.com/shufo/prettier-plugin-blade/commit/9515a19265313158fdc37fb15c6be38e0b26635f))
* 🤖 drop execa from dependencies ([ed39de9](https://www.github.com/shufo/prettier-plugin-blade/commit/ed39de90d5c4b5b343bd1a48fc00bef0a5a153b2))
### Performance
* ⚡️ use synckit worker to gain throuhput on format ([c9c0839](https://www.github.com/shufo/prettier-plugin-blade/commit/c9c0839bfb3ed46a0e2f4ecfc7e683e3c87a8872))
### [1.0.1](https://www.github.com/shufo/prettier-plugin-blade/compare/v1.0.0...v1.0.1) (2022-01-27)
### Miscellaneous
* release 1.0.1 ([7f6c7c2](https://www.github.com/shufo/prettier-plugin-blade/commit/7f6c7c270e734557e82d36b55729f3d1e47f290d))
## 1.0.0 (2022-01-27)
### Miscellaneous
* 🤖 add .gitattributes ([b0b24c9](https://www.github.com/shufo/prettier-plugin-blade/commit/b0b24c99548734575c4ba693c9fea7377256c6dc))
* 🤖 add cross-env to dependencies ([6daea74](https://www.github.com/shufo/prettier-plugin-blade/commit/6daea749403f2d019c258ffef679c06e03527904))
* 🤖 drop support for node under 14.x ([3e8a6cf](https://www.github.com/shufo/prettier-plugin-blade/commit/3e8a6cfaec8e3da7c78299ef3c46860311324e24))
* Initialize ([dab21bb](https://www.github.com/shufo/prettier-plugin-blade/commit/dab21bbe47fbf5fe16147f4ff8895e0ccb116a35))
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Shuhei Hayashibara
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,346 @@
<div align="center">
<img alt="Prettier"
src="https://raw.githubusercontent.com/prettier/prettier-logo/master/images/prettier-icon-light.png">
<img alt="PHP" height="180" hspace="25" vspace="15"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Laravel.svg/500px-Laravel.svg.png">
</div>
<h2 align="center">Prettier Blade Plugin</h2>
<p align="center">
<a href="https://github.com/shufo/prettier-plugin-blade/actions">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/shufo/prettier-plugin-blade/node.yml?style=flat-square">
</a>
<a href="https://www.npmjs.com/package/@prettier/plugin-php">
<img alt="npm version" src="https://img.shields.io/npm/v/@shufo/prettier-plugin-blade.svg?style=flat-square">
</a>
</p>
Format your blade template using Prettier
## Features
- Automatically indent markup inside directives
- Automatically add spacing to blade template markers
- PHP 8 syntax support (null safe operator, named arguments)
- Compliant to PSR-2 coding standard (PHP code inside directives)
- Automatically sort Tailwind CSS classes with respect of `tailwind.config.js`
## Installation
```bash
$ npm install --save-dev @shufo/prettier-plugin-blade prettier
# yarn
$ yarn add -D @shufo/prettier-plugin-blade prettier
# pnpm
$ pnpm add -D @shufo/prettier-plugin-blade prettier
```
then, add in your [Prettier configuration](https://prettier.io/docs/en/configuration.html):
```json
{
"plugins": [
"@shufo/prettier-plugin-blade",
],
"overrides": [
{
"files": ["*.blade.php"],
"options": {
"parser": "blade"
"tabWidth": 4,
}
}
]
}
```
## Usage (CLI)
```bash
$ ./node_modules/.bin/prettier --write resources/**/*.blade.php
```
https://user-images.githubusercontent.com/1641039/151354641-6305805e-8e0c-4226-8331-64195f85160e.mp4
## Example
### Input
```blade
@extends('frontend.layouts.app')
@section('title') foo
@endsection
@section('content')
<section id="content">
<div class="container mod-users-pd-h">
<div class="pf-user-header">
<div></div>
<p>@lang('users.index')</p>
</div>
<div class="pf-users-branch">
<ul class="pf-users-branch__list">
@foreach ($users as $user)
<li>
<img src="{{ asset('img/frontend/icon/branch-arrow.svg') }}" alt="branch_arrow">
{{ link_to_route('frontend.users.user.show', $users['name'], $users['_id']) }}
</li>
@endforeach
</ul>
<div class="pf-users-branch__btn">
@can('create', App\Models\User::class)
{!! link_to_route('frontend.users.user.create', __('users.create'), [1, 2, 3], ['class' => 'btn']) !!}
@endcan
</div>
</div>
</div>
</section>
@endsection
@section('footer')
@stop
```
### Output
```blade
@extends('frontend.layouts.app')
@section('title') foo
@endsection
@section('content')
<section id="content">
<div class="container mod-users-pd-h">
<div class="pf-user-header">
<div></div>
<p>@lang('users.index')</p>
</div>
<div class="pf-users-branch">
<ul class="pf-users-branch__list">
@foreach ($users as $user)
<li>
<img src="{{ asset('img/frontend/icon/branch-arrow.svg') }}" alt="branch_arrow">
{{ link_to_route('frontend.users.user.show', $users['name'], $users['_id']) }}
</li>
@endforeach
</ul>
<div class="pf-users-branch__btn">
@can('create', App\Models\User::class)
{!! link_to_route('frontend.users.user.create', __('users.create'), [1, 2, 3], ['class' => 'btn']) !!}
@endcan
</div>
</div>
</div>
</section>
@endsection
@section('footer')
@stop
```
## Options
You can use these options for prettier blade plugin in prettier CLI.
| key | description |
| ---------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--tab-width` | Number of spaces per indentation level. default: `4` |
| `--print-width` | The line length where Prettier will try wrap. default: `120` |
| `--wrap-attributes` | The way to wrap attributes. [`auto`\|`force`\|`force-aligned`\|`force-expand-multiline`\|`aligned-multiple`\|`preserve`\|`preserve-aligned`]. default: `auto` |
| `--end-with-new-line` | End output with newline. default: `true` |
| `--sort-tailwindcss-classes` | Sort Tailwind CSS classes. It will automatically look for and respect `tailwind.config.js` if it exists. default: `false` |
| `--tailwindcss-config-path` | Path to your custom Tailwind configuration file. This option is only available if `--sort-tailwindcss-classes` is present. default: `''` |
| `--sort-html-attributes` | Sort HTML Attributes in the specified order. [`none` \| `alphabetical` \| [`code-guide`](https://codeguide.co/) \| [`idiomatic`](https://github.com/necolas/idiomatic-html#attribute-order) \| [`vuejs`](https://eslint.vuejs.org/rules/attributes-order.html)] default: `none` |
| `--no-php-syntax-check` | Disable PHP syntax checking. default: `false` |
### `.prettierrc` example
```json
{
"printWidth": 120,
"tabWidth": 4,
"wrapAttributes": "auto",
"sortTailwindcssClasses": true,
"sortHtmlAttributes": "none",
"noPhpSyntaxCheck": false
}
```
## Disabling format in file
To disable formatting in your file, you can use blade/html comments in the following format:
```blade
{{-- prettier-ignore-start --}}
{{ $foo }}
{{ $bar }}
{{-- prettier-ignore-end --}}
or
<!-- prettier-ignore-start -->
{{ $foo }}
{{ $bar }}
<!-- prettier-ignore-end -->
```
To disable formatting on a specific line, you can use comment in the following format:
```blade
{{-- prettier-ignore --}}
{{ $foo }}
or
<!-- prettier-ignore -->
{{ $foo }}
```
## Editor Integration
The editors below are confirmed to work with this plugin.
### VSCode
You can use [Prettier extension for VSCode](https://github.com/prettier/prettier-vscode) to format blade in VSCode. You need to install this plugin as a local dependency. see https://github.com/prettier/prettier-vscode#prettier-resolution
If you want to use a formatter without Prettier, please consider to use the [vscode-blade-formatter](https://github.com/shufo/vscode-blade-formatter) instead.
### Vim
You can use [coc-prettier](https://github.com/neoclide/coc-prettier) plugin on [coc.nvim](https://github.com/neoclide/coc.nvim)
If you want to use formater without Prettier, please consider to using [coc-blade](https://github.com/yaegassy/coc-blade)
### JetBrains WebStorm, PHPStorm, PyCharm...
You can use the [Prettier Plugin](https://plugins.jetbrains.com/plugin/10456-prettier) for JetBrains IDE.
Add extension setting `blade.php` to `File | Settings | Languages & Frameworks | JavaScript | Prettier | Run for files`:
e.g.
`{**/*,*}.{js,ts,jsx,tsx,blade.php}`
and turn on checkbox `On 'Reformat Code' action`
Restart your IDE if you get the error: 'Prettier: File \*.php has unsupported type'
## Limitation
This plugin is based on [blade-formatter](https://github.com/shufo/blade-formatter) which does not generate ASTs with lexer, so it might break indentation on complex blade.
Like:
- The mix of open/closed HTML tag and directives
❌ Example of **unexpected** code
```blade
@if ($user)
<div>
@else
</div>
@endif
```
⭕ Example of **expected** code
```blade
@if ($user)
<div>foo</div>
@else
<div>bar</div>
@endif
```
Please keep the blade template as simple as possible for better formatting.
## API
You can format the blade file programmatically using Prettier's API
```js
const prettier = require("prettier");
const input = `
<div>
@if ($user)
{{ $foo }}
@else
{{ $bar }}
@endif
</div>
`;
const res = prettier.format(input, { parser: "blade" });
console.log(res);
// =>
//<div>
// @if ($user)
// {{ $foo }}
// @else
// {{ $bar }}
// @endif
//</div>
```
## Development
```bash
$ yarn install
$ yarn run watch # watch changes
```
## Testing
```bash
$ yarn install
$ yarn run test
```
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## Contributors
<!-- readme: collaborators,contributors -start -->
<table>
<tr>
<td align="center">
<a href="https://github.com/shufo">
<img src="https://avatars.githubusercontent.com/u/1641039?v=4" width="100;" alt="shufo"/>
<br />
<sub><b>Shuhei Hayashibara</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/howdu">
<img src="https://avatars.githubusercontent.com/u/533658?v=4" width="100;" alt="howdu"/>
<br />
<sub><b>Beej</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ianjamieson">
<img src="https://avatars.githubusercontent.com/u/2786904?v=4" width="100;" alt="ianjamieson"/>
<br />
<sub><b>Ian Jamieson</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mortenscheel">
<img src="https://avatars.githubusercontent.com/u/6514342?v=4" width="100;" alt="mortenscheel"/>
<br />
<sub><b>Morten Scheel</b></sub>
</a>
</td></tr>
</table>
<!-- readme: collaborators,contributors -end -->
## LICENSE
MIT
@@ -0,0 +1,2 @@
"use strict";var f=Object.create;var n=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},o=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of y(r))!w.call(e,s)&&s!==t&&n(e,s,{get:()=>r[s],enumerable:!(i=b(r,s))||i.enumerable});return e};var l=(e,r,t)=>(t=e!=null?f(h(e)):{},o(r||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e)),x=e=>o(n({},"__esModule",{value:!0}),e);var S={};P(S,{defaultOptions:()=>m,languages:()=>A,options:()=>g,parsers:()=>C,printers:()=>L});module.exports=x(S);var c=require("prettier"),d=require("synckit"),a=l(require("path")),p=(e,r,t)=>{let i={indentSize:t.tabWidth,wrapLineLength:t.printWidth,wrapAttributes:t.singleAttributePerLine?"force-expand-multiline":t.bracketSameLine?"force-aligned":t.wrapAttributes,endWithNewline:t.endWithNewline,useTabs:t.useTabs,sortTailwindcssClasses:t.sortTailwindcssClasses,tailwindcssConfigPath:T(t.filepath,t.tailwindcssConfigPath),sortHtmlAttributes:t.sortHtmlAttributes,noMultipleEmptyLines:!0,noPhpSyntaxCheck:t.noPhpSyntaxCheck,customHtmlAttributesOrder:t.customHtmlAttributesOrder};return{type:"blade-formatter",body:(0,d.createSyncFn)(require.resolve("../src/worker"))(e,i),end:e.length,source:e,start:0}};function T(e,r){if(!r)return;if(a.default.isAbsolute(r??""))return r;let t=c.resolveConfigFile.sync(e);return a.default.resolve(a.default.dirname(t??""),r??"")}var u=e=>{let r=e.getValue();switch(r.type){case"blade-formatter":return r.body}throw new Error(`Unknown node type: ${r.type}`)};var m={tabWidth:4,printWidth:120},g={wrapAttributes:{type:"string",category:"Blade",default:"auto",description:"The way to wrap attributes. [auto|force|force-aligned|force-expand-multiline|aligned-multiple|preserve|preserve-aligned]",since:"1.0.0"},endWithNewLine:{type:"boolean",category:"Blade",default:!0,description:"End output with newline.",since:"1.0.0"},sortTailwindcssClasses:{type:"boolean",category:"Blade",default:!1,description:"Sort Tailwindcss classes automatically. This option respects `tailwind.config.js`.",since:"1.0.0"},tailwindcssConfigPath:{type:"string",category:"Blade",default:"",description:"Path to custom Tailwindcss config. This option is available only when `sortTailwindcssClasses` is present.",since:"1.5.7"},sortHtmlAttributes:{type:"string",category:"Blade",default:"none",description:"Sort HTML Attributes. [none|alphabetical|code-guide|idiomatic|vuejs|custom]",since:"1.5.0"},customHtmlAttributesOrder:{type:"string",category:"Blade",default:"",description:'Comma separated custom HTML attributes order. e.g. "id, aria-.+, class, src". To enable this you must specify sort html attributes option as `custom`. You can use regex for attribute names.',since:"1.8.0"},noPhpSyntaxCheck:{type:"boolean",category:"Blade",default:!1,description:"Disable PHP syntax checking",since:"1.7.0"}};var A=[{name:"Blade",parsers:["blade"],since:"1.0.0",extensions:[".blade.php"],tmScope:"source.blade.php",aceMode:"text",linguistLanguageId:33,vscodeLanguageIds:["blade"]}],C={blade:{parse:p,astFormat:"blade-format",locStart(e){return e.start},locEnd(e){return e.end}}},L={"blade-format":{print:u}};0&&(module.exports={defaultOptions,languages,options,parsers,printers});
//# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/parser.ts", "../src/printer.ts", "../src/options.ts"],
"sourcesContent": ["import { parse } from \"./parser\";\nimport { print } from \"./printer\";\nimport { options, defaultOptions } from \"./options\";\nimport { Parser, Printer, SupportLanguage } from \"prettier\";\n\nexport const languages: SupportLanguage[] = [\n {\n name: \"Blade\",\n parsers: [\"blade\"],\n since: \"1.0.0\",\n extensions: [\".blade.php\"],\n tmScope: \"source.blade.php\",\n aceMode: \"text\",\n linguistLanguageId: 33,\n vscodeLanguageIds: [\"blade\"],\n },\n];\n\nexport const parsers: { [k: string]: Parser } = {\n blade: {\n parse,\n astFormat: \"blade-format\",\n locStart(node: any) {\n return node.start;\n },\n locEnd(node: any) {\n return node.end;\n },\n },\n};\n\nexport const printers: { [k: string]: Printer } = {\n \"blade-format\": {\n print,\n },\n};\n\nexport { options, defaultOptions };\n", "import { Parser, ParserOptions, resolveConfigFile } from \"prettier\";\nimport { FormatterOption } from \"blade-formatter\";\nimport { createSyncFn } from \"synckit\";\nimport path from 'path';\n\nexport const parse = (\n text: string,\n parsers: { [parserName: string]: Parser },\n opts: ParserOptions & FormatterOption\n) => {\n const formatterOptions: FormatterOption = {\n indentSize: opts.tabWidth,\n wrapLineLength: opts.printWidth,\n wrapAttributes: opts.singleAttributePerLine ? 'force-expand-multiline' : opts.bracketSameLine ? 'force-aligned' : opts.wrapAttributes,\n endWithNewline: opts.endWithNewline,\n useTabs: opts.useTabs,\n sortTailwindcssClasses: opts.sortTailwindcssClasses,\n tailwindcssConfigPath: resolveTailwindConfigPath(opts.filepath, opts.tailwindcssConfigPath),\n sortHtmlAttributes: opts.sortHtmlAttributes,\n noMultipleEmptyLines: true,\n noPhpSyntaxCheck: opts.noPhpSyntaxCheck,\n customHtmlAttributesOrder: opts.customHtmlAttributesOrder,\n };\n\n const syncFn = createSyncFn(require.resolve(\"./worker\"));\n const result = syncFn(text, formatterOptions);\n\n return {\n type: \"blade-formatter\",\n body: result,\n end: text.length,\n source: text,\n start: 0,\n };\n};\n\nfunction resolveTailwindConfigPath(filepath: string | undefined, optionPath: string | undefined): string | undefined {\n if (!optionPath) {\n return;\n }\n\n if (path.isAbsolute(optionPath ?? '')) {\n return optionPath;\n }\n\n const prettierRcPath = resolveConfigFile.sync(filepath);\n\n return path.resolve(path.dirname(prettierRcPath ?? ''), optionPath ?? '')\n}", "import { AstPath, Doc } from \"prettier\";\n\nexport const print = (path: AstPath): Doc => {\n const node = path.getValue();\n\n switch (node.type) {\n case \"blade-formatter\": {\n return node.body;\n }\n }\n\n throw new Error(`Unknown node type: ${node.type}`);\n};\n", "export const defaultOptions = {\n tabWidth: 4,\n printWidth: 120,\n};\n\nexport const options = {\n wrapAttributes: {\n type: \"string\",\n category: \"Blade\",\n default: \"auto\",\n description:\n \"The way to wrap attributes. [auto|force|force-aligned|force-expand-multiline|aligned-multiple|preserve|preserve-aligned]\",\n since: \"1.0.0\",\n },\n endWithNewLine: {\n type: \"boolean\",\n category: \"Blade\",\n default: true,\n description: \"End output with newline.\",\n since: \"1.0.0\",\n },\n sortTailwindcssClasses: {\n type: \"boolean\",\n category: \"Blade\",\n default: false,\n description: \"Sort Tailwindcss classes automatically. This option respects `tailwind.config.js`.\",\n since: \"1.0.0\",\n },\n tailwindcssConfigPath: {\n type: \"string\",\n category: \"Blade\",\n default: '',\n description: \"Path to custom Tailwindcss config. This option is available only when `sortTailwindcssClasses` is present.\",\n since: \"1.5.7\",\n },\n sortHtmlAttributes: {\n type: \"string\",\n category: \"Blade\",\n default: \"none\",\n description: \"Sort HTML Attributes. [none|alphabetical|code-guide|idiomatic|vuejs|custom]\",\n since: \"1.5.0\",\n },\n customHtmlAttributesOrder: {\n type: \"string\",\n category: \"Blade\",\n default: \"\",\n description: \"Comma separated custom HTML attributes order. e.g. \\\"id, aria-.+, class, src\\\". To enable this you must specify sort html attributes option as `custom`. You can use regex for attribute names.\",\n since: \"1.8.0\",\n },\n noPhpSyntaxCheck: {\n type: \"boolean\",\n category: \"Blade\",\n default: false,\n description: \"Disable PHP syntax checking\",\n since: \"1.7.0\",\n },\n};\n\n"],
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,cAAAC,EAAA,YAAAC,EAAA,YAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAP,GCAA,IAAAQ,EAAyD,oBAEzDC,EAA6B,mBAC7BC,EAAiB,mBAEJC,EAAQ,CACnBC,EACAC,EACAC,IACG,CACH,IAAMC,EAAoC,CACxC,WAAYD,EAAK,SACjB,eAAgBA,EAAK,WACrB,eAAgBA,EAAK,uBAAyB,yBAA2BA,EAAK,gBAAkB,gBAAkBA,EAAK,eACvH,eAAgBA,EAAK,eACrB,QAASA,EAAK,QACd,uBAAwBA,EAAK,uBAC7B,sBAAuBE,EAA0BF,EAAK,SAAUA,EAAK,qBAAqB,EAC1F,mBAAoBA,EAAK,mBACzB,qBAAsB,GACtB,iBAAkBA,EAAK,iBACvB,0BAA2BA,EAAK,yBAClC,EAKA,MAAO,CACL,KAAM,kBACN,QALa,gBAAa,gBAAgB,eAAU,CAAC,EACjCF,EAAMG,CAAgB,EAK1C,IAAKH,EAAK,OACV,OAAQA,EACR,MAAO,CACT,CACF,EAEA,SAASI,EAA0BC,EAA8BC,EAAoD,CACnH,GAAI,CAACA,EACH,OAGF,GAAI,EAAAC,QAAK,WAAWD,GAAc,EAAE,EAClC,OAAOA,EAGT,IAAME,EAAiB,oBAAkB,KAAKH,CAAQ,EAEtD,OAAO,EAAAE,QAAK,QAAQ,EAAAA,QAAK,QAAQC,GAAkB,EAAE,EAAGF,GAAc,EAAE,CAC1E,CC9CO,IAAMG,EAASC,GAAuB,CAC3C,IAAMC,EAAOD,EAAK,SAAS,EAE3B,OAAQC,EAAK,KAAM,CACjB,IAAK,kBACH,OAAOA,EAAK,IAEhB,CAEA,MAAM,IAAI,MAAM,sBAAsBA,EAAK,MAAM,CACnD,ECZO,IAAMC,EAAiB,CAC5B,SAAU,EACV,WAAY,GACd,EAEaC,EAAU,CACrB,eAAgB,CACd,KAAM,SACN,SAAU,QACV,QAAS,OACT,YACE,2HACF,MAAO,OACT,EACA,eAAgB,CACd,KAAM,UACN,SAAU,QACV,QAAS,GACT,YAAa,2BACb,MAAO,OACT,EACA,uBAAwB,CACtB,KAAM,UACN,SAAU,QACV,QAAS,GACT,YAAa,qFACb,MAAO,OACT,EACA,sBAAuB,CACrB,KAAM,SACN,SAAU,QACV,QAAS,GACT,YAAa,6GACb,MAAO,OACT,EACA,mBAAoB,CAClB,KAAM,SACN,SAAU,QACV,QAAS,OACT,YAAa,8EACb,MAAO,OACT,EACA,0BAA2B,CACzB,KAAM,SACN,SAAU,QACV,QAAS,GACT,YAAa,gMACb,MAAO,OACT,EACA,iBAAkB,CAChB,KAAM,UACN,SAAU,QACV,QAAS,GACT,YAAa,8BACb,MAAO,OACT,CACF,EHnDO,IAAMC,EAA+B,CAC1C,CACE,KAAM,QACN,QAAS,CAAC,OAAO,EACjB,MAAO,QACP,WAAY,CAAC,YAAY,EACzB,QAAS,mBACT,QAAS,OACT,mBAAoB,GACpB,kBAAmB,CAAC,OAAO,CAC7B,CACF,EAEaC,EAAmC,CAC9C,MAAO,CACL,MAAAC,EACA,UAAW,eACX,SAASC,EAAW,CAClB,OAAOA,EAAK,KACd,EACA,OAAOA,EAAW,CAChB,OAAOA,EAAK,GACd,CACF,CACF,EAEaC,EAAqC,CAChD,eAAgB,CACd,MAAAC,CACF,CACF",
"names": ["src_exports", "__export", "defaultOptions", "languages", "options", "parsers", "printers", "__toCommonJS", "import_prettier", "import_synckit", "import_path", "parse", "text", "parsers", "opts", "formatterOptions", "resolveTailwindConfigPath", "filepath", "optionPath", "path", "prettierRcPath", "print", "path", "node", "defaultOptions", "options", "languages", "parsers", "parse", "node", "printers", "print"]
}
@@ -0,0 +1,4 @@
#!/usr/bin/env node
const cli = require('../dist/cli-bundle');
cli.default();
@@ -0,0 +1,64 @@
#!/usr/bin/env node
"use strict";
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = function(cb, mod) {
return function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
};
// node_modules/semver-compare/index.js
var require_semver_compare = __commonJS({
"node_modules/semver-compare/index.js": function(exports2, module2) {
module2.exports = function cmp(a, b) {
var pa = a.split(".");
var pb = b.split(".");
for (var i = 0; i < 3; i++) {
var na = Number(pa[i]);
var nb = Number(pb[i]);
if (na > nb)
return 1;
if (nb > na)
return -1;
if (!isNaN(na) && isNaN(nb))
return 1;
if (isNaN(na) && !isNaN(nb))
return -1;
}
return 0;
};
}
});
// node_modules/please-upgrade-node/index.js
var require_please_upgrade_node = __commonJS({
"node_modules/please-upgrade-node/index.js": function(exports2, module2) {
var semverCompare = require_semver_compare();
module2.exports = function pleaseUpgradeNode2(pkg, opts) {
var opts = opts || {};
var requiredVersion = pkg.engines.node.replace(">=", "");
var currentVersion = process.version.replace("v", "");
if (semverCompare(currentVersion, requiredVersion) === -1) {
if (opts.message) {
console.error(opts.message(requiredVersion));
} else {
console.error(
pkg.name + " requires at least version " + requiredVersion + " of Node, please upgrade"
);
}
if (opts.hasOwnProperty("exitCode")) {
process.exit(opts.exitCode);
} else {
process.exit(1);
}
}
};
}
});
// bin/prettier.js
var pleaseUpgradeNode = require_please_upgrade_node();
var packageJson = require("./package.json");
pleaseUpgradeNode(packageJson);
var cli = require("./cli.js");
module.exports = cli.run(process.argv.slice(2));
@@ -0,0 +1,58 @@
{
"name": "@shufo/prettier-plugin-blade",
"engines": {
"node": ">= 14.0.0"
},
"version": "1.8.12",
"dependencies": {
"blade-formatter": "^1.32.12",
"prettier": "^2.6.2",
"synckit": "^0.8.5"
},
"devDependencies": {
"@types/concat-stream": "^2.0.0",
"@types/jest": "^29.0.0",
"@types/prettier": "^2.4.4",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.30.0",
"codecov": "^3.8.3",
"concat-stream": "^2.0.0",
"cross-env": "^7.0.3",
"esbuild": "^0.17.0",
"esbuild-node-externals": "^1.4.1",
"eslint": "^8.15.0",
"jest": "^29.0.0",
"ts-jest": "^29.0.0",
"ts-node": "^10.5.0",
"typescript": "^5.0.0"
},
"main": "dist/index.js",
"scripts": {
"build": "cross-env NODE_ENV=production node esbuild.ts",
"watch": "node esbuild.ts",
"test": "yarn build && jest",
"lint": "eslint . --ext .ts",
"fix": "eslint . --ext .ts --fix",
"prettier": "prettier --plugin . --plugin-search-dir ."
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/shufo/prettier-plugin-blade.git"
},
"files": [
"dist",
"src",
"CHANGELOG.md"
],
"keywords": [
"prettier",
"blade",
"formatter",
"laravel"
],
"author": "Shuhei Hayashibara"
}
@@ -0,0 +1,38 @@
import { parse } from "./parser";
import { print } from "./printer";
import { options, defaultOptions } from "./options";
import { Parser, Printer, SupportLanguage } from "prettier";
export const languages: SupportLanguage[] = [
{
name: "Blade",
parsers: ["blade"],
since: "1.0.0",
extensions: [".blade.php"],
tmScope: "source.blade.php",
aceMode: "text",
linguistLanguageId: 33,
vscodeLanguageIds: ["blade"],
},
];
export const parsers: { [k: string]: Parser } = {
blade: {
parse,
astFormat: "blade-format",
locStart(node: any) {
return node.start;
},
locEnd(node: any) {
return node.end;
},
},
};
export const printers: { [k: string]: Printer } = {
"blade-format": {
print,
},
};
export { options, defaultOptions };
@@ -0,0 +1,58 @@
export const defaultOptions = {
tabWidth: 4,
printWidth: 120,
};
export const options = {
wrapAttributes: {
type: "string",
category: "Blade",
default: "auto",
description:
"The way to wrap attributes. [auto|force|force-aligned|force-expand-multiline|aligned-multiple|preserve|preserve-aligned]",
since: "1.0.0",
},
endWithNewLine: {
type: "boolean",
category: "Blade",
default: true,
description: "End output with newline.",
since: "1.0.0",
},
sortTailwindcssClasses: {
type: "boolean",
category: "Blade",
default: false,
description: "Sort Tailwindcss classes automatically. This option respects `tailwind.config.js`.",
since: "1.0.0",
},
tailwindcssConfigPath: {
type: "string",
category: "Blade",
default: '',
description: "Path to custom Tailwindcss config. This option is available only when `sortTailwindcssClasses` is present.",
since: "1.5.7",
},
sortHtmlAttributes: {
type: "string",
category: "Blade",
default: "none",
description: "Sort HTML Attributes. [none|alphabetical|code-guide|idiomatic|vuejs|custom]",
since: "1.5.0",
},
customHtmlAttributesOrder: {
type: "string",
category: "Blade",
default: "",
description: "Comma separated custom HTML attributes order. e.g. \"id, aria-.+, class, src\". To enable this you must specify sort html attributes option as `custom`. You can use regex for attribute names.",
since: "1.8.0",
},
noPhpSyntaxCheck: {
type: "boolean",
category: "Blade",
default: false,
description: "Disable PHP syntax checking",
since: "1.7.0",
},
};
@@ -0,0 +1,49 @@
import { Parser, ParserOptions, resolveConfigFile } from "prettier";
import { FormatterOption } from "blade-formatter";
import { createSyncFn } from "synckit";
import path from 'path';
export const parse = (
text: string,
parsers: { [parserName: string]: Parser },
opts: ParserOptions & FormatterOption
) => {
const formatterOptions: FormatterOption = {
indentSize: opts.tabWidth,
wrapLineLength: opts.printWidth,
wrapAttributes: opts.singleAttributePerLine ? 'force-expand-multiline' : opts.bracketSameLine ? 'force-aligned' : opts.wrapAttributes,
endWithNewline: opts.endWithNewline,
useTabs: opts.useTabs,
sortTailwindcssClasses: opts.sortTailwindcssClasses,
tailwindcssConfigPath: resolveTailwindConfigPath(opts.filepath, opts.tailwindcssConfigPath),
sortHtmlAttributes: opts.sortHtmlAttributes,
noMultipleEmptyLines: true,
noPhpSyntaxCheck: opts.noPhpSyntaxCheck,
customHtmlAttributesOrder: opts.customHtmlAttributesOrder,
};
const syncFn = createSyncFn(require.resolve("./worker"));
const result = syncFn(text, formatterOptions);
return {
type: "blade-formatter",
body: result,
end: text.length,
source: text,
start: 0,
};
};
function resolveTailwindConfigPath(filepath: string | undefined, optionPath: string | undefined): string | undefined {
if (!optionPath) {
return;
}
if (path.isAbsolute(optionPath ?? '')) {
return optionPath;
}
const prettierRcPath = resolveConfigFile.sync(filepath);
return path.resolve(path.dirname(prettierRcPath ?? ''), optionPath ?? '')
}
@@ -0,0 +1,13 @@
import { AstPath, Doc } from "prettier";
export const print = (path: AstPath): Doc => {
const node = path.getValue();
switch (node.type) {
case "blade-formatter": {
return node.body;
}
}
throw new Error(`Unknown node type: ${node.type}`);
};
@@ -0,0 +1,7 @@
const { runAsWorker } = require("synckit");
const { BladeFormatter } = require("blade-formatter");
runAsWorker(async (text, options) => {
const result = await new BladeFormatter(options).format(text);
return result;
});