Skip to content

Commit d13a6a3

Browse files
committed
Upgrade to prettier@3
1 parent c88781a commit d13a6a3

File tree

8 files changed

+22
-34
lines changed

8 files changed

+22
-34
lines changed

.prettierignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

.prettierrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"singleQuote": true,
44
"trailingComma": "none",
55
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
7-
"pluginSearchDirs": ["."],
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
87
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
98
"semi": false,
109
"proseWrap": "always",

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Use anywhere in your app - just import the toast controller.
5656

5757
`MyComponent.svelte`:
5858

59+
<!-- prettier-ignore -->
5960
```html
6061
<script>
6162
import { toast } from '@zerodevx/svelte-toast'
@@ -448,6 +449,7 @@ Additional CSS vars are exposed - specifically, `--toastBtnContent` allows the '
448449
to be changed. As with CSS `content` keys for pseudo elements, `url()` can be used to load external
449450
or inline icons.
450451

452+
<!-- prettier-ignore -->
451453
```html
452454
<script>
453455
import { toast, SvelteToast } from '@zerodevx/svelte-toast'

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"preview": "vite preview",
99
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
1010
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
11-
"format": "prettier --plugin-search-dir . --write .",
12-
"lint": "prettier --plugin-search-dir . --check . && eslint && npm run check",
11+
"format": "prettier --write .",
12+
"lint": "prettier --check . && eslint && npm run check",
1313
"test": "playwright test",
1414
"prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1",
1515
"build": "zx build.mjs",
@@ -36,8 +36,9 @@
3636
"is-port-reachable": "^4.0.0",
3737
"postcss": "^8.4.47",
3838
"postcss-load-config": "^4.0.2",
39-
"prettier": "^2.8.8",
40-
"prettier-plugin-svelte": "^2.10.1",
39+
"prettier": "^3.3.3",
40+
"prettier-plugin-svelte": "^3.2.6",
41+
"prettier-plugin-tailwindcss": "^0.6.6",
4142
"prismjs": "^1.29.0",
4243
"svelte": "^4.2.19",
4344
"svelte-check": "^4.0.2",

src/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

src/app.postcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@layer base {
66
html {
7-
@apply bg-base-100 text-base-content font-sans;
7+
@apply bg-base-100 font-sans text-base-content;
88
}
99
}
1010

src/routes/+page.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,33 +382,33 @@ $: formatted = Prism.highlight(code, Prism.languages.javascript, 'javascript')
382382
/>
383383
</svelte:head>
384384
385-
<div class="max-w-3xl mx-auto px-6 mt-8 mb-8">
386-
<h1 class="text-4xl font-bold text-center mb-2">svelte-toast</h1>
387-
<div class="text-center mb-6">
385+
<div class="mx-auto mb-8 mt-8 max-w-3xl px-6">
386+
<h1 class="mb-2 text-center text-4xl font-bold">svelte-toast</h1>
387+
<div class="mb-6 text-center">
388388
<a
389-
class="badge font-mono text-xs px-4 py-3 hover:bg-base-300"
389+
class="badge px-4 py-3 font-mono text-xs hover:bg-base-300"
390390
href="https://github.com/zerodevx/svelte-toast"
391391
title="Visit Github repo"
392392
target="_blank"
393393
rel="noreferrer">GITHUB v{version}</a
394394
>
395395
</div>
396-
<p class="max-w-2xl mx-auto text-center mb-6">
396+
<p class="mx-auto mb-6 max-w-2xl text-center">
397397
Simple elegant toast notifications for modern web frontends in very little lines of code.
398398
Because a demo helps better than a thousand API docs, so here it is. Use in Vanilla JS (<strong
399399
>8kB</strong
400400
>
401401
gzipped) or as a Svelte component.
402402
</p>
403403
<div class="mockup-code mb-6">
404-
<pre class="w-full h-64 text-sm overflow-x-auto"><code class="language-javascript"
404+
<pre class="h-64 w-full overflow-x-auto text-sm"><code class="language-javascript"
405405
>{@html formatted}</code
406406
></pre>
407407
</div>
408408
<div class="flex flex-wrap justify-around">
409409
{#each buttons as btn}
410410
<button
411-
class="btn btn-primary w-40 mb-2 text-xs"
411+
class="btn btn-primary mb-2 w-40 text-xs"
412412
class:selected={selected === btn.name}
413413
on:click={() => {
414414
clicked(btn)

src/routes/Dummy.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ const accepted = () => clicked(true)
1818
const declined = () => clicked(false)
1919
</script>
2020

21-
<div class="w-full h-40 bg-yellow-500 flex flex-col p-2">
22-
<div class="h-6 flex flex-row items-center mb-1">
21+
<div class="flex h-40 w-full flex-col bg-yellow-500 p-2">
22+
<div class="mb-1 flex h-6 flex-row items-center">
2323
<h1 class="font-bold">{title}</h1>
2424
<div class="flex-1" />
2525
<span class="font-mono text-xs font-bold">[toastId: {toastId}]</span>
2626
</div>
27-
<p class="flex-1 text-sm overflow-y-scroll">
27+
<p class="flex-1 overflow-y-scroll text-sm">
2828
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
2929
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
3030
laboris nisi ut aliquip ex ea commodo consequat.
3131
</p>
32-
<div class="h-10 flex flex-row justify-around">
32+
<div class="flex h-10 flex-row justify-around">
3333
<button class="btn btn-sm" on:click={declined}>DECLINE</button>
34-
<button class="btn btn-sm btn-primary" on:click={accepted} data-testid="dummyAccept"
34+
<button class="btn btn-primary btn-sm" on:click={accepted} data-testid="dummyAccept"
3535
>ACCEPT</button
3636
>
3737
</div>

0 commit comments

Comments
 (0)