Skip to content

Commit dd1baaa

Browse files
committed
🪄 No more semi-colons
1 parent e5a9489 commit dd1baaa

File tree

35 files changed

+910
-902
lines changed

35 files changed

+910
-902
lines changed

‎.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"trailingComma": "none",
55
"printWidth": 100,
66
"plugins": ["prettier-plugin-svelte"],
7-
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
7+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
8+
"semi": false
89
}

‎eslint.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import js from '@eslint/js';
2-
import ts from 'typescript-eslint';
3-
import svelte from 'eslint-plugin-svelte';
4-
import prettier from 'eslint-config-prettier';
5-
import globals from 'globals';
1+
import js from '@eslint/js'
2+
import ts from 'typescript-eslint'
3+
import svelte from 'eslint-plugin-svelte'
4+
import prettier from 'eslint-config-prettier'
5+
import globals from 'globals'
66

77
/** @type {import('eslint').Linter.FlatConfig[]} */
88
export default [
@@ -30,4 +30,4 @@ export default [
3030
{
3131
ignores: ['build/', '.svelte-kit/', 'dist/']
3232
}
33-
];
33+
]

‎package.json

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
"name": "mydocs",
3-
"version": "0.0.1",
4-
"private": true,
5-
"scripts": {
6-
"dev": "vite dev",
7-
"build": "vite build",
8-
"preview": "vite preview",
9-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11-
"lint": "prettier --check . && eslint .",
12-
"format": "prettier --write ."
13-
},
14-
"devDependencies": {
15-
"@iconify-json/ri": "^1.0.0",
16-
"@iconify/json": "^2.2.219",
17-
"@sveltejs/adapter-auto": "^3.0.0",
18-
"@sveltejs/adapter-static": "^3.0.2",
19-
"@sveltejs/kit": "^2.0.0",
20-
"@sveltejs/vite-plugin-svelte": "^3.0.0",
21-
"@svelteness/kit-docs": "^1.1.5",
22-
"@types/eslint": "^8.56.7",
23-
"clsx": "^1.0.0",
24-
"eslint": "^9.0.0",
25-
"eslint-config-prettier": "^9.1.0",
26-
"eslint-plugin-svelte": "^2.36.0",
27-
"globals": "^15.0.0",
28-
"prettier": "^3.1.1",
29-
"prettier-plugin-svelte": "^3.1.2",
30-
"shiki": "^0.12.0",
31-
"svelte": "^4.2.7",
32-
"svelte-check": "^3.6.0",
33-
"tslib": "^2.4.1",
34-
"typescript": "^5.0.0",
35-
"typescript-eslint": "^8.0.0-alpha.20",
36-
"unplugin-icons": "^0.19.0",
37-
"vite": "^5.0.3"
38-
},
39-
"type": "module",
40-
"dependencies": {
41-
"svelte-youtube-embed": "^0.3.0"
42-
}
2+
"name": "mydocs",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite dev",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11+
"lint": "prettier --check . && eslint .",
12+
"format": "prettier --write ."
13+
},
14+
"devDependencies": {
15+
"@iconify-json/ri": "^1.0.0",
16+
"@iconify/json": "^2.2.219",
17+
"@sveltejs/adapter-auto": "^3.0.0",
18+
"@sveltejs/adapter-static": "^3.0.2",
19+
"@sveltejs/kit": "^2.0.0",
20+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
21+
"@svelteness/kit-docs": "^1.1.5",
22+
"@types/eslint": "^8.56.7",
23+
"clsx": "^1.0.0",
24+
"eslint": "^9.0.0",
25+
"eslint-config-prettier": "^9.1.0",
26+
"eslint-plugin-svelte": "^2.36.0",
27+
"globals": "^15.0.0",
28+
"prettier": "^3.1.1",
29+
"prettier-plugin-svelte": "^3.1.2",
30+
"shiki": "^0.12.0",
31+
"svelte": "^4.2.7",
32+
"svelte-check": "^3.6.0",
33+
"tslib": "^2.4.1",
34+
"typescript": "^5.0.0",
35+
"typescript-eslint": "^8.0.0-alpha.20",
36+
"unplugin-icons": "^0.19.0",
37+
"vite": "^5.0.3"
38+
},
39+
"type": "module",
40+
"dependencies": {
41+
"svelte-youtube-embed": "^0.3.0"
42+
}
4343
}

‎src/app.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference types="@svelteness/kit-docs/globals" />
2-
import type { CompositionEventHandler } from 'svelte/elements';
2+
import type { CompositionEventHandler } from 'svelte/elements'
33

44
// See https://kit.svelte.dev/docs/types#app
55
// for information about these interfaces
@@ -14,10 +14,10 @@ declare global {
1414

1515
declare namespace svelteHTML {
1616
interface HTMLProps<T> {
17-
'on:enter'?: CompositionEventHandler<T>;
18-
'on:exit'?: CompositionEventHandler<T>;
17+
'on:enter'?: CompositionEventHandler<T>
18+
'on:exit'?: CompositionEventHandler<T>
1919
}
2020
}
2121
}
2222

23-
export {};
23+
export {}

‎src/app.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77

88
<script>
9-
const key = 'svelteness::color-scheme';
10-
const scheme = localStorage[key];
11-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
9+
const key = 'svelteness::color-scheme'
10+
const scheme = localStorage[key]
11+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
1212
if (scheme === 'dark' || (scheme !== 'light' && prefersDark)) {
13-
document.documentElement.classList.add('dark');
13+
document.documentElement.classList.add('dark')
1414
} else {
15-
document.documentElement.classList.remove('dark');
15+
document.documentElement.classList.remove('dark')
1616
}
1717
</script>
1818

‎src/components/VideoCarousel.svelte

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
<script lang="ts" context="module">
2-
import { Button } from '@svelteness/kit-docs';
2+
import { Button } from '@svelteness/kit-docs'
33
</script>
44

55
<script lang="ts">
6-
import Youtube from 'svelte-youtube-embed';
7-
import { writable } from 'svelte/store';
6+
import Youtube from 'svelte-youtube-embed'
7+
import { writable } from 'svelte/store'
88
9-
let index = writable(0);
9+
let index = writable(0)
1010
1111
const VIDEOS = [
12-
'fthlphRmsjY',
13-
'dd7pqAPd-p0',
14-
'M2R3zgvbZ30',
15-
'0xPyRA-he5c',
16-
'0UCrI7NJ5KI',
17-
'yfaQM3aHgxE',
18-
'sC3FqzpDrpQ',
19-
'CO2kYUMpYPk',
20-
'fs0NUGmsa10',
21-
'4VlwyI0EHo4'
22-
];
12+
'fthlphRmsjY', // I Added Mr Beast to Minecraft...
13+
'dd7pqAPd-p0', // Phantom Manor
14+
'M2R3zgvbZ30', // How to Mine a Tree
15+
'0xPyRA-he5c', // Cataclysmic Emissary
16+
'0UCrI7NJ5KI', // New Boss Test
17+
'-6pLFvW5_Dk', // Camera Animation Test
18+
'yfaQM3aHgxE', // Mordecai the Unending
19+
'sC3FqzpDrpQ', // Diamond Golem
20+
'CO2kYUMpYPk', // Excuse me Sir
21+
'fs0NUGmsa10', // Butter Dog
22+
'4VlwyI0EHo4' // Funny Mobile Game
23+
]
2324
2425
async function getYoutubeVideoTitle(id: string) {
2526
const res = await fetch(
2627
`//www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${id}&format=json`
27-
);
28-
const videoInfo = await res.json();
28+
)
29+
const videoInfo = await res.json()
2930
30-
return videoInfo?.title;
31+
return videoInfo?.title
3132
}
3233
</script>
3334

@@ -42,7 +43,7 @@
4243
<div
4344
class="thumbnail-container"
4445
on:click={(e) => {
45-
index.set(VIDEOS.indexOf(id));
46+
index.set(VIDEOS.indexOf(id))
4647
}}
4748
>
4849
<Button class="thumbnail-button">

‎src/kit-docs/CodeFence.svelte

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
<script lang="ts">
2-
import { getI18nContext } from '@svelteness/kit-docs';
2+
import { getI18nContext } from '@svelteness/kit-docs'
33
// import MCFunctionTML from '../mcfunction.tmLanguage.json';
44
5-
import clsx from 'clsx';
5+
import clsx from 'clsx'
66
7-
import CopyFileIcon from '~icons/ri/file-copy-line';
7+
import CopyFileIcon from '~icons/ri/file-copy-line'
88
9-
export let lang: string | null = null;
10-
export let ext: string | null = null;
11-
export let code: string | null = null;
12-
export let rawCode: string | null = null;
13-
export let title: string | null = null;
14-
export let linesCount: number = (code?.match(/"line"/g) || []).length;
15-
export let showLineNumbers = false;
16-
export let highlightLines: [number, number][] = [];
17-
export let copyHighlightOnly = false;
18-
export let copySteps = false;
19-
export let showCopyCode = copySteps || copyHighlightOnly;
9+
export let lang: string | null = null
10+
export let ext: string | null = null
11+
export let code: string | null = null
12+
export let rawCode: string | null = null
13+
export let title: string | null = null
14+
export let linesCount: number = (code?.match(/"line"/g) || []).length
15+
export let showLineNumbers = false
16+
export let highlightLines: [number, number][] = []
17+
export let copyHighlightOnly = false
18+
export let copySteps = false
19+
export let showCopyCode = copySteps || copyHighlightOnly
2020
21-
const i18n = getI18nContext();
21+
const i18n = getI18nContext()
2222
23-
let currentStep = 1;
24-
let stepHighlightLines: [number, number][] = [];
23+
let currentStep = 1
24+
let stepHighlightLines: [number, number][] = []
2525
2626
$: if (copySteps) {
27-
stepHighlightLines = [highlightLines[currentStep - 1] ?? [currentStep, currentStep]];
27+
stepHighlightLines = [highlightLines[currentStep - 1] ?? [currentStep, currentStep]]
2828
}
2929
30-
$: currentHighlightedLines = copySteps ? stepHighlightLines : highlightLines;
30+
$: currentHighlightedLines = copySteps ? stepHighlightLines : highlightLines
3131
3232
const isHighlightLine = (lineNumber: number, _?: any): boolean =>
33-
currentHighlightedLines.some(([start, end]) => lineNumber >= start && lineNumber <= end);
33+
currentHighlightedLines.some(([start, end]) => lineNumber >= start && lineNumber <= end)
3434
3535
// `linesCount-1` since last line is always empty (prettier)
36-
$: lines = [...Array(linesCount - 1).keys()].map((n) => n + 1);
36+
$: lines = [...Array(linesCount - 1).keys()].map((n) => n + 1)
3737
38-
$: unescapedRawCode = rawCode?.replace(/&#8203/g, '');
38+
$: unescapedRawCode = rawCode?.replace(/&#8203/g, '')
3939
40-
let showCopiedCodePrompt = false;
40+
let showCopiedCodePrompt = false
4141
async function copyCodeToClipboard() {
4242
try {
4343
const copiedCode =
@@ -46,30 +46,30 @@
4646
?.split('\n')
4747
.filter((_, i) => isHighlightLine(i + 1))
4848
.join('\n')
49-
: unescapedRawCode;
49+
: unescapedRawCode
5050
51-
await navigator.clipboard.writeText(copiedCode || '');
51+
await navigator.clipboard.writeText(copiedCode || '')
5252
} catch (e) {
5353
// no-op
5454
}
5555
56-
showCopiedCodePrompt = true;
56+
showCopiedCodePrompt = true
5757
if (copySteps) {
58-
const nextStep = currentStep + 1;
59-
const maxSteps = highlightLines.length > 0 ? highlightLines.length : lines.length;
60-
currentStep = nextStep > maxSteps ? 1 : nextStep;
58+
const nextStep = currentStep + 1
59+
const maxSteps = highlightLines.length > 0 ? highlightLines.length : lines.length
60+
currentStep = nextStep > maxSteps ? 1 : nextStep
6161
}
6262
}
6363
6464
$: if (showCopiedCodePrompt) {
6565
setTimeout(() => {
66-
showCopiedCodePrompt = false;
67-
}, 400);
66+
showCopiedCodePrompt = false
67+
}, 400)
6868
}
6969
70-
$: showTopBar = title || showCopyCode;
71-
$: hasTopbarTitle = title || ext;
72-
$: topbarTitle = title ?? (ext === 'sh' ? 'terminal' : ext);
70+
$: showTopBar = title || showCopyCode
71+
$: hasTopbarTitle = title || ext
72+
$: topbarTitle = title ?? (ext === 'sh' ? 'terminal' : ext)
7373
</script>
7474

7575
<div

‎src/kit-docs/CodeInline.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
export let code: string;
2+
export let code: string
33
</script>
44

55
<code>{code}</code>

0 commit comments

Comments
 (0)