Skip to content

Commit 8057d7c

Browse files
chore: order imports with a Prettier plugin
1 parent e08194b commit 8057d7c

21 files changed

+206
-58
lines changed

.prettierrc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"trailingComma": "none",
44
"printWidth": 100,
55
"arrowParens": "avoid",
6-
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
6+
"plugins": [
7+
"prettier-plugin-svelte",
8+
"prettier-plugin-tailwindcss",
9+
"@trivago/prettier-plugin-sort-imports"
10+
],
711
"overrides": [
812
{
913
"files": "*.svelte",
@@ -12,5 +16,18 @@
1216
}
1317
}
1418
],
15-
"tailwindStylesheet": "./src/app.css"
19+
"tailwindStylesheet": "./src/app.css",
20+
"importOrder": [
21+
"^\\.\\./app.css$",
22+
"^svelte$",
23+
"^@sveltejs/kit.*$",
24+
"^svelte/.*$",
25+
"\\$(app|env)/.+$",
26+
"<THIRD_PARTY_MODULES>",
27+
"\\$lib/(?!components).+$",
28+
"\\$lib/components/ui/.+$",
29+
"\\$lib/components/.+$",
30+
"^\\.*/.+$"
31+
],
32+
"importOrderSortSpecifiers": true
1633
}

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import eslint from "@eslint/js";
2-
import tseslint from "typescript-eslint";
3-
import svelte from "eslint-plugin-svelte";
42
import prettierConfig from "eslint-config-prettier/flat";
3+
import svelte from "eslint-plugin-svelte";
54
import globals from "globals";
5+
import tseslint from "typescript-eslint";
66
import svelteConfig from "./svelte.config.js";
77

88
export default tseslint.config(

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@tailwindcss/typography": "^0.5.16",
3131
"@tailwindcss/vite": "^4.1.5",
3232
"@total-typescript/ts-reset": "^0.6.1",
33+
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
3334
"@types/eslint-config-prettier": "^6.11.3",
3435
"@types/node": "^22.15.14",
3536
"@types/semver": "^7.7.0",

pnpm-lock.yaml

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

src/lib/components/AnimatedCollapsibleContent.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
Based on https://bits-ui.com/docs/components/collapsible#best-practices
55
-->
66
<script lang="ts">
7-
import { Collapsible, type WithoutChildrenOrChild } from "bits-ui";
8-
import { slide, type SlideParams } from "svelte/transition";
97
import type { Snippet } from "svelte";
8+
import { type SlideParams, slide } from "svelte/transition";
9+
import { Collapsible, type WithoutChildrenOrChild } from "bits-ui";
1010
1111
let {
1212
ref = $bindable(null),

src/lib/components/MarkdownRenderer.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
*/
88
import type { ComponentProps } from "svelte";
99
import type { ClassValue } from "svelte/elements";
10+
import posthog from "posthog-js";
11+
import rehypeRaw from "rehype-raw";
1012
import Markdown, { type Plugin } from "svelte-exmarkdown";
1113
import { gfmPlugin } from "svelte-exmarkdown/gfm";
12-
import rehypeRaw from "rehype-raw";
13-
import posthog from "posthog-js";
1414
import { cn } from "$lib/utils";
1515
import { Button } from "$lib/components/ui/button";
1616

src/lib/components/ScreenSize.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
// From https://gist.github.com/WarningImHack3r/375c559c5ee120408f9df2390ec2747a
33
// Inspired by https://gist.github.com/Sh4yy/0300299ae60af4910bcb341703946330
4-
import { innerWidth, innerHeight } from "svelte/reactivity/window";
4+
import { innerHeight, innerWidth } from "svelte/reactivity/window";
55
import { slide } from "svelte/transition";
66
77
let screens = $state<{ name: string; size: number }[]>([]);

src/lib/repositories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Category, Entries, Prettify, RepoInfo } from "$lib/types";
21
import { uniq } from "$lib/array";
2+
import type { Category, Entries, Prettify, RepoInfo } from "$lib/types";
33

44
export const repos: Record<Category, { name: string; repos: RepoInfo[] }> = {
55
svelte: {

0 commit comments

Comments
 (0)