diff --git a/CHANGELOG.md b/CHANGELOG.md index d9995045..6a0c93a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +- Add support for `prettier-plugin-multiline-arrays` ([#299](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/299)) ## [0.6.5] - 2024-06-17 -- Only re-apply string escaping when necessary ([#295](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/295)) +- Only re-apply string escaping when necessary ([#295](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/295)) ## [0.6.4] - 2024-06-12 diff --git a/README.md b/README.md index 3852f88c..b5f154d2 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ This plugin uses Prettier APIs that can only be used by one plugin at a time, ma - `prettier-plugin-css-order` - `prettier-plugin-import-sort` - `prettier-plugin-jsdoc` +- `prettier-plugin-multiline-arrays` - `prettier-plugin-organize-attributes` - `prettier-plugin-organize-imports` - `prettier-plugin-style-order` diff --git a/package-lock.json b/package-lock.json index 19147929..a67ee18f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "prettier-plugin-import-sort": "^0.0.7", "prettier-plugin-jsdoc": "^1.0.1", "prettier-plugin-marko": "^3.1.1", + "prettier-plugin-multiline-arrays": "^3.0.6", "prettier-plugin-organize-attributes": "^1.0.0", "prettier-plugin-organize-imports": "^3.2.4", "prettier-plugin-sort-imports": "^1.8.1", @@ -62,6 +63,7 @@ "prettier-plugin-import-sort": "*", "prettier-plugin-jsdoc": "*", "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", "prettier-plugin-organize-attributes": "*", "prettier-plugin-organize-imports": "*", "prettier-plugin-sort-imports": "*", @@ -99,6 +101,9 @@ "prettier-plugin-marko": { "optional": true }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, "prettier-plugin-organize-attributes": { "optional": true }, @@ -147,6 +152,17 @@ "integrity": "sha512-o/ObKgtMzl8SlpIdzaxFnt7SATKPxu4oIP/1NL+HDJRzxfJcAkOTAb/ZKMRyULbz4q+1t2/DAebs2Z1QairkZw==", "dev": true }, + "node_modules/@augment-vir/common": { + "version": "28.2.3", + "resolved": "https://registry.npmjs.org/@augment-vir/common/-/common-28.2.3.tgz", + "integrity": "sha512-RBxXZRVG4HspVvnMS8KBJ91hdn3m/4UKNNnEM2x89iAR9yUrLF1v2DLs7jL+sHiRLGXM6g6aQqkZlA4I4fKszw==", + "dev": true, + "dependencies": { + "browser-or-node": "^3.0.0", + "run-time-assertions": "^1.5.1", + "type-fest": "^4.20.1" + } + }, "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", @@ -2459,6 +2475,12 @@ "node": ">=8" } }, + "node_modules/browser-or-node": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-3.0.0.tgz", + "integrity": "sha512-iczIdVJzGEYhP5DqQxYM9Hh7Ztpqqi+CXZpSmX8ALFs9ecXkQIeqRyM6TfxEfMVpwhl3dSuDvxdzzo9sUOIVBQ==", + "dev": true + }, "node_modules/browser-refresh-client": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/browser-refresh-client/-/browser-refresh-client-1.1.4.tgz", @@ -3289,6 +3311,12 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/expect-type": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-0.15.0.tgz", + "integrity": "sha512-yWnriYB4e8G54M5/fAFj7rCIBiKs1HAACaY13kCz6Ku0dezjS9aMcfcdVK2X8Tv2tEV1BPz/wKfQ7WA4S/d8aA==", + "dev": true + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -5671,6 +5699,19 @@ "prettier": "^3" } }, + "node_modules/prettier-plugin-multiline-arrays": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/prettier-plugin-multiline-arrays/-/prettier-plugin-multiline-arrays-3.0.6.tgz", + "integrity": "sha512-FrWVa7MoDQo9b5XoLPrqIDClb0k+O8wOIsIr1DutRXhcerLY8PfIe/yYeTVD/vpRISkSXCBEYmj5Voe0wb5dEQ==", + "dev": true, + "dependencies": { + "@augment-vir/common": "^28.1.0", + "proxy-vir": "^1.0.0" + }, + "peerDependencies": { + "prettier": ">=3.0.0" + } + }, "node_modules/prettier-plugin-organize-attributes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-plugin-organize-attributes/-/prettier-plugin-organize-attributes-1.0.0.tgz", @@ -5764,6 +5805,32 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/proxy-vir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-vir/-/proxy-vir-1.0.0.tgz", + "integrity": "sha512-WV1gkBxUOwLSz0Bn09tisIqLK7leAqtFm/474t3L0hQKJw7/gdrkGcWw0/OT1PhSy+TDS6swfq7Niuoq3XJhkQ==", + "dev": true, + "dependencies": { + "@augment-vir/common": "^23.3.4" + } + }, + "node_modules/proxy-vir/node_modules/@augment-vir/common": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/@augment-vir/common/-/common-23.4.0.tgz", + "integrity": "sha512-QIrJ1doD00TNbOzeVrk9KgPTzRlIjayxERnhtbQjK/AFPj5yElcB03GbnGdQZPzws/R+5gfMM5cZiH7QyBP+Kg==", + "dev": true, + "dependencies": { + "browser-or-node": "^2.1.1", + "run-time-assertions": "^1.0.0", + "type-fest": "^4.10.2" + } + }, + "node_modules/proxy-vir/node_modules/browser-or-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.1.1.tgz", + "integrity": "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==", + "dev": true + }, "node_modules/pug-error": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.0.0.tgz", @@ -6121,6 +6188,17 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/run-time-assertions": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/run-time-assertions/-/run-time-assertions-1.5.1.tgz", + "integrity": "sha512-yyAFU3+ZGw+zjMu0s7uOSGqKIRDLaCnl80VIKdtwuu4ejxcWHCRj2mxL6elVNtI7fytHwk4e40e3IrdNkXihlw==", + "dev": true, + "dependencies": { + "@augment-vir/common": "^28.0.0", + "expect-type": "~0.15.0", + "type-fest": "^4.18.2" + } + }, "node_modules/s.color": { "version": "0.0.15", "resolved": "https://registry.npmjs.org/s.color/-/s.color-0.0.15.tgz", @@ -7270,6 +7348,18 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "4.20.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.20.1.tgz", + "integrity": "sha512-R6wDsVsoS9xYOpy8vgeBlqpdOyzJ12HNfQhC/aAKWM3YoCV9TtunJzh/QpkMgeDhkoynDcw5f1y+qF9yc/HHyg==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "5.4.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", diff --git a/package.json b/package.json index 00035fc0..5bf93bbc 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "prettier-plugin-import-sort": "^0.0.7", "prettier-plugin-jsdoc": "^1.0.1", "prettier-plugin-marko": "^3.1.1", + "prettier-plugin-multiline-arrays": "^3.0.6", "prettier-plugin-organize-attributes": "^1.0.0", "prettier-plugin-organize-imports": "^3.2.4", "prettier-plugin-sort-imports": "^1.8.1", @@ -83,6 +84,7 @@ "prettier-plugin-import-sort": "*", "prettier-plugin-jsdoc": "*", "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", "prettier-plugin-organize-attributes": "*", "prettier-plugin-organize-imports": "*", "prettier-plugin-sort-imports": "*", @@ -120,6 +122,9 @@ "prettier-plugin-marko": { "optional": true }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, "prettier-plugin-organize-attributes": { "optional": true }, diff --git a/src/plugins.ts b/src/plugins.ts index c788675d..82d2f984 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -174,6 +174,7 @@ async function loadCompatiblePlugins() { 'prettier-plugin-css-order', 'prettier-plugin-import-sort', 'prettier-plugin-jsdoc', + 'prettier-plugin-multiline-arrays', 'prettier-plugin-organize-attributes', 'prettier-plugin-style-order', 'prettier-plugin-sort-imports', diff --git a/tests/plugins.test.js b/tests/plugins.test.js index 80df1718..f00d730e 100644 --- a/tests/plugins.test.js +++ b/tests/plugins.test.js @@ -94,6 +94,30 @@ let tests = [ ], }, }, + { + versions: [3], + plugins: ['prettier-plugin-multiline-arrays'], + tests: { + babel: [ + [ + `const array = [\n'one']`, + `const array = [\n 'one',\n]`, + ], + ], + typescript: [ + [ + `const array = [\n'one']`, + `const array = [\n 'one',\n]`, + ], + ], + 'babel-ts': [ + [ + `const array = [\n'one']`, + `const array = [\n 'one',\n]`, + ], + ], + }, + }, { versions: [2, 3], plugins: ['prettier-plugin-organize-imports'],