Skip to content

Commit 8e4efba

Browse files
Test against Prettier v3.6 (#375)
* Bump Prettier to v3.6 * Tweak plugin detection These can be `URL`s now apparently * Enable test * Bump JSDoc It’s now compatible with Prettier v3.6 * fix check
1 parent afa39a5 commit 8e4efba

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

package-lock.json

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@
5858
"marko": "^5.31.18",
5959
"postcss": "^8.4.35",
6060
"postcss-import": "^16.0.1",
61-
"prettier": "^3.2",
61+
"prettier": "^3.6",
6262
"prettier-plugin-astro": "^0.12.2",
6363
"prettier-plugin-css-order": "^2.0.0",
6464
"prettier-plugin-import-sort": "^0.0.7",
65-
"prettier-plugin-jsdoc": "^1.0.1",
65+
"prettier-plugin-jsdoc": "^1.3.3",
6666
"prettier-plugin-marko": "^3.1.1",
6767
"prettier-plugin-multiline-arrays": "^3.0.6",
6868
"prettier-plugin-organize-attributes": "^1.0.0",

src/plugins.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ export async function loadPlugins() {
4949
let path = maybeResolve(name)
5050

5151
for (let plugin of options.plugins) {
52+
if (plugin instanceof URL) {
53+
if (plugin.protocol !== 'file:') continue
54+
if (plugin.hostname !== '') continue
55+
56+
plugin = plugin.pathname
57+
}
58+
5259
if (typeof plugin === 'string') {
5360
if (plugin === name || plugin === path) {
5461
return mod

tests/tests.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ export let tests: Record<string, TestEntry[]> = {
239239
// TODO: Enable this test — it causes console noise but not a failure
240240
// t`<div [ngClass]="{ '${no}': foo && definitely&a:syntax*error }" class="${yes}"></div>`,
241241

242-
// TODO: Enable test once we can run all tests against Prettier v3.6
243-
// t`<div [ngClass]="\`${yes}\`"></div>`,
242+
t`<div [ngClass]="\`${yes}\`"></div>`,
244243
],
245244
css: [...css, t`@apply ${yes} !important;`],
246245
scss: [

0 commit comments

Comments
 (0)