Skip to content

Commit 3a4221d

Browse files
committed
fix: linting
1 parent dd61239 commit 3a4221d

28 files changed

+201
-2192
lines changed

.eslintrc.cjs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
module.exports = {
22
root: true,
33
parser: '@typescript-eslint/parser',
4-
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5-
plugins: ['svelte3', '@typescript-eslint'],
4+
extends: [
5+
'plugin:svelte/recommended',
6+
'plugin:svelte/prettier',
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
'prettier'
10+
],
11+
plugins: ['@typescript-eslint', 'prettier'],
612
ignorePatterns: ['*.cjs'],
7-
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8-
settings: {
9-
'svelte3/typescript': () => require('typescript')
13+
rules: {
14+
'prettier/prettier': 'error',
15+
'@typescript-eslint/no-non-null-assertion': 'off'
1016
},
1117
parserOptions: {
1218
sourceType: 'module',
1319
ecmaVersion: 2020
1420
},
21+
overrides: [
22+
{
23+
files: ['*.svelte'],
24+
parser: 'svelte-eslint-parser',
25+
26+
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
27+
parserOptions: {
28+
parser: '@typescript-eslint/parser'
29+
}
30+
}
31+
],
1532
env: {
1633
browser: true,
1734
es2017: true,

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ node_modules
88
!.env.example
99

1010
.idea
11-
.vscode
11+
.vscode
12+
13+
yarn-error.log

.prettierrc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@
33
"singleQuote": true,
44
"trailingComma": "none",
55
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
7-
"pluginSearchDirs": ["."],
8-
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
9-
}
6+
"plugins": [
7+
"prettier-plugin-svelte",
8+
"prettier-plugin-tailwindcss"
9+
],
10+
"pluginSearchDirs": [
11+
"."
12+
],
13+
"overrides": [
14+
{
15+
"files": "*.svelte",
16+
"options": {
17+
"parser": "svelte"
18+
}
19+
}
20+
]
21+
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1212
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
1313
"lint": "prettier --plugin-search-dir . --check . && eslint .",
14-
"format": "prettier --plugin-search-dir . --write .",
14+
"format": "prettier --plugin-search-dir . --write . && eslint . --fix",
1515
"tunnel": "cloudflared tunnel run --url http://localhost:5173"
1616
},
1717
"devDependencies": {
@@ -26,11 +26,13 @@
2626
"autoprefixer": "^10.4.7",
2727
"eslint": "^8.16.0",
2828
"eslint-config-prettier": "^8.3.0",
29-
"eslint-plugin-svelte3": "^4.0.0",
29+
"eslint-plugin-prettier": "^4.2.1",
30+
"eslint-plugin-svelte": "^2.14.1",
3031
"postcss": "^8.4.14",
3132
"postcss-load-config": "^4.0.1",
3233
"prettier": "^2.6.2",
3334
"prettier-plugin-svelte": "^2.7.0",
35+
"prettier-plugin-tailwindcss": "^0.2.1",
3436
"svelte": "^3.44.0",
3537
"svelte-check": "^2.7.1",
3638
"svelte-icons": "^2.1.0",
@@ -46,4 +48,4 @@
4648
"clsx": "^1.2.1",
4749
"nprogress": "^0.2.0"
4850
}
49-
}
51+
}

src/app.postcss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/* Setup page theming */
77
body {
8-
@apply bg-white text-black dark:bg-neutral-900 dark:text-white transition-all;
8+
@apply bg-white text-black transition-all dark:bg-neutral-900 dark:text-white;
99
}
1010

1111
@layer utilities {
@@ -20,16 +20,16 @@ body {
2020

2121
/* Basic Cards */
2222
.basic-card {
23-
@apply p-4 border-[1px] rounded-md border-neutral-300 dark:border-neutral-700 bg-neutral-100 dark:bg-neutral-800 bg-opacity-70 dark:bg-opacity-70;
23+
@apply rounded-md border-[1px] border-neutral-300 bg-neutral-100 bg-opacity-70 p-4 dark:border-neutral-700 dark:bg-neutral-800 dark:bg-opacity-70;
2424
}
2525

2626
/* Links */
2727
.link {
28-
@apply text-neutral-400 hover:text-neutral-200 transition-all;
28+
@apply text-neutral-400 transition-all hover:text-neutral-200;
2929
}
3030
}
3131

3232
/* Icon sizing */
3333
.icon.sm {
34-
@apply w-[24px] h-[24px];
34+
@apply h-[24px] w-[24px];
3535
}

src/components/art/CommissionCard.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
<a href={commission.slug ? `/art/${commission.slug}` : undefined}>
88
<div
9-
class="flex flex-col border-[1px] rounded-lg overflow-clip border-neutral-300 dark:border-neutral-700 bg-neutral-100 dark:bg-neutral-800 bg-opacity-70 transition-all hover:scale-[101%]"
9+
class="flex flex-col overflow-clip rounded-lg border-[1px] border-neutral-300 bg-neutral-100 bg-opacity-70 transition-all hover:scale-[101%] dark:border-neutral-700 dark:bg-neutral-800"
1010
>
1111
<img
1212
src={getURL(commission.images[0])}
1313
alt={commission.title}
14-
class="object-cover object-top aspect-square"
14+
class="aspect-square object-cover object-top"
1515
/>
1616

1717
<div class="p-4">
1818
<h2 class="font-medium text-blue-400">{commission.title}</h2>
19-
<p class="text-body line-clamp-2 text-ellipsis">
19+
<p class="text-body text-ellipsis line-clamp-2">
2020
By {commission.artist.name}
2121
</p>
2222
</div>

src/components/art/CommissionImage.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import clsx from "clsx";
2+
import clsx from 'clsx';
33
44
export let src: string;
55
export let title: string | undefined = undefined;
@@ -13,9 +13,12 @@
1313
href={src}
1414
target="_blank"
1515
rel="noopener noreferrer"
16-
class={clsx("relative rounded-3xl overflow-clip transition-all hover:scale-[101%] hover:shadow-2xl", className)}
16+
class={clsx(
17+
'relative overflow-clip rounded-3xl transition-all hover:scale-[101%] hover:shadow-2xl',
18+
className
19+
)}
1720
>
18-
<img {src} alt={title} class="aspect-auto object-cover h-full w-full" />
21+
<img {src} alt={title} class="aspect-auto h-full w-full object-cover" />
1922

2023
{#if title || subtitle}
2124
<div class="absolute inset-0 bg-gradient-to-b from-transparent to-black opacity-50" />

src/components/art/CommissionPage.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<div
1010
class={clsx(
11-
'flex flex-col gap-6 content-between',
11+
'flex flex-col content-between gap-6',
1212
commission.layout === 'horizontal' ? 'lg:flex-row' : ''
1313
)}
1414
>
@@ -20,14 +20,14 @@
2020
<img
2121
src={commission.artist.icon}
2222
alt={commission.artist.name}
23-
class="w-12 h-12 rounded-full object-cover"
23+
class="h-12 w-12 rounded-full object-cover"
2424
/>
2525
{/if}
2626

2727
{#if commission.artist.link}
2828
<a
2929
href={commission.artist.link}
30-
class="flex flex-col group"
30+
class="group flex flex-col"
3131
target="_blank"
3232
rel="noopener noreferrer"
3333
>
@@ -50,12 +50,12 @@
5050
{#if commission.links}
5151
<div>
5252
<p class="font-semibold text-neutral-400">Links</p>
53-
<ul class="flex flex-col sm:flex-row gap-4">
53+
<ul class="flex flex-col gap-4 sm:flex-row">
5454
{#each commission.links as link}
5555
<li>
5656
<a
5757
href={link.href}
58-
class="flex flex-col group"
58+
class="group flex flex-col"
5959
target="_blank"
6060
rel="noopener noreferrer"
6161
>

src/components/base/GradientCanvas.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { onMount } from 'svelte';
44
55
let canvas: HTMLCanvasElement;
6-
let t: number = 0;
6+
let t = 0;
77
88
onMount(() => {
99
canvas.classList.remove('opacity-0');
@@ -50,5 +50,5 @@
5050
bind:this={canvas}
5151
width="32"
5252
height="32"
53-
class="w-full h-full opacity-0 transition-all duration-500"
53+
class="h-full w-full opacity-0 transition-all duration-500"
5454
/>

src/components/base/NavBar.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
</script>
1616

1717
<div class="flex flex-row justify-between">
18-
<div class="flex flex-row gap-6 items-center">
18+
<div class="flex flex-row items-center gap-6">
1919
<img
2020
src="https://avatars.githubusercontent.com/u/23714764?v=4"
2121
alt="Stella"
22-
class="rounded-full w-10 h-10"
22+
class="h-10 w-10 rounded-full"
2323
/>
2424

2525
{#each links as { label, to, mode }}
2626
<NavLink {to} {mode}>{label}</NavLink>
2727
{/each}
2828
</div>
2929

30-
<div class="flex flex-row gap-6 items-center">
30+
<div class="flex flex-row items-center gap-6">
3131
<NavLink to="https://twitter.com/KodingDev_">
3232
<div class="icon sm">
3333
<FaTwitter />

0 commit comments

Comments
 (0)