Skip to content

Commit 0d2d8ec

Browse files
committed
refactor!: use default prettier config except for 4-space tabs
1 parent eab63ca commit 0d2d8ec

13 files changed

+78
-85
lines changed

.prettierrc.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
tabWidth: 4
2-
trailingComma: none
3-
arrowParens: avoid
42
plugins:
53
- prettier-plugin-astro
64
- prettier-plugin-tailwindcss
75
- "@ianvs/prettier-plugin-sort-imports"
8-
overrides:
9-
- files: "package.json"
10-
options:
11-
tabWidth: 2

astro.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ export default defineConfig({
1313
tailwind({
1414
config: {
1515
path: "tailwind.config.js",
16-
applyBaseStyles: false
17-
}
16+
applyBaseStyles: false,
17+
},
1818
}),
1919
prefetch(),
2020
sitemap(),
21-
mdx()
21+
mdx(),
2222
],
2323
markdown: {
2424
remarkPlugins: [remarkReadingTime],
2525
shikiConfig: {
26-
theme: "catppuccin-mocha"
27-
}
28-
}
26+
theme: "catppuccin-mocha",
27+
},
28+
},
2929
});

package.json

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
2-
"private": true,
3-
"scripts": {
4-
"dev": "astro dev",
5-
"build": "astro build",
6-
"preview": "astro preview",
7-
"astro": "astro"
8-
},
9-
"dependencies": {
10-
"@astrojs/mdx": "^3.1.3",
11-
"@astrojs/prefetch": "^0.2.1",
12-
"@astrojs/tailwind": "^3.1.1",
13-
"@catppuccin/palette": "^1.2.0",
14-
"chart.js": "^4.2.1",
15-
"mdast-util-to-string": "^4.0.0",
16-
"react": "^18.2.0",
17-
"react-dom": "^18.2.0",
18-
"react-typist-component": "1.0.5",
19-
"reading-time": "^1.5.0"
20-
},
21-
"devDependencies": {
22-
"@astrojs/react": "^2.1.0",
23-
"@astrojs/sitemap": "^1.2.1",
24-
"@catppuccin/tailwindcss": "^0.1.1",
25-
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
26-
"@types/react": "^18.0.28",
27-
"astro": "latest",
28-
"prettier": "^3.2.5",
29-
"prettier-plugin-astro": "0.13.0",
30-
"prettier-plugin-tailwindcss": "^0.6.5",
31-
"tailwindcss": "^3.2.7",
32-
"typescript": "^5.0.2"
33-
}
2+
"private": true,
3+
"scripts": {
4+
"dev": "astro dev",
5+
"build": "astro build",
6+
"preview": "astro preview",
7+
"astro": "astro"
8+
},
9+
"dependencies": {
10+
"@astrojs/mdx": "^3.1.3",
11+
"@astrojs/prefetch": "^0.2.1",
12+
"@astrojs/tailwind": "^3.1.1",
13+
"@catppuccin/palette": "^1.2.0",
14+
"chart.js": "^4.2.1",
15+
"mdast-util-to-string": "^4.0.0",
16+
"react": "^18.2.0",
17+
"react-dom": "^18.2.0",
18+
"react-typist-component": "1.0.5",
19+
"reading-time": "^1.5.0"
20+
},
21+
"devDependencies": {
22+
"@astrojs/react": "^2.1.0",
23+
"@astrojs/sitemap": "^1.2.1",
24+
"@catppuccin/tailwindcss": "^0.1.1",
25+
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
26+
"@types/react": "^18.0.28",
27+
"astro": "latest",
28+
"prettier": "^3.2.5",
29+
"prettier-plugin-astro": "0.13.0",
30+
"prettier-plugin-tailwindcss": "^0.6.5",
31+
"tailwindcss": "^3.2.7",
32+
"typescript": "^5.0.2"
33+
}
3434
}

postcss.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module.exports = {
33
"postcss-import": {},
44
"tailwindcss/nesting": {},
55
tailwindcss: {},
6-
autoprefixer: {}
7-
}
6+
autoprefixer: {},
7+
},
88
};

src/components/TypistLoop.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export interface Props {
77

88
const shuffle = (array: string[]) =>
99
array
10-
.map(value => ({ value, sort: Math.random() }))
10+
.map((value) => ({ value, sort: Math.random() }))
1111
.sort((a, b) => a.sort - b.sort)
1212
.map(({ value }) => value);
1313

14-
const TypistLoop: FC<Props> = ({ texts }) => (
14+
const TypistLoop: FC = ({ texts }) => (
1515
<div className="h-24">
1616
<Typist typingDelay={100} loop>
17-
{shuffle(texts).map(text => (
17+
{shuffle(texts).map((text) => (
1818
<div key={text}>
1919
<Typist.Delay ms={1000} />
2020
<p className="text-center text-2xl md:text-4xl italic opacity-80 select-none rainbow-text neon">

src/lib/chart.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const CHART_COLOURS = [
1818
"rgb(249, 226, 175, 0.5)",
1919
"rgb(166, 227, 161, 0.5)",
2020
"rgb(137, 180, 250, 0.5)",
21-
"rgb(180, 190, 254, 0.5)"
21+
"rgb(180, 190, 254, 0.5)",
2222
];
2323

2424
export const createChart = (target: HTMLCanvasElement, data: Record) =>
@@ -33,19 +33,19 @@ export const createChart = (target: HTMLCanvasElement, data: Record) =>
3333
display: true,
3434
font: {
3535
family: "PT Sans",
36-
size: 18
37-
}
38-
}
39-
}
40-
}
36+
size: 18,
37+
},
38+
},
39+
},
40+
},
4141
},
4242
data: {
4343
labels: Object.keys(data),
4444
datasets: [
4545
{
4646
data: Object.values(data),
47-
backgroundColor: CHART_COLOURS
48-
}
49-
]
50-
}
47+
backgroundColor: CHART_COLOURS,
48+
},
49+
],
50+
},
5151
});

src/lib/fade.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ for (let i = 0; i < container.children.length; i++) {
1010
child.style.pointerEvents = "unset";
1111
child.style.opacity = "1";
1212
},
13-
i * 200 + 500
13+
i * 200 + 500,
1414
);
1515
}

src/lib/matrix.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const MESSAGES = [
2121
"THEMATRIX",
2222
"3.1415926535",
2323
"6.2831853071",
24-
"2.7182818284"
24+
"2.7182818284",
2525
];
2626

2727
const canvas = document.querySelector("canvas")!;
@@ -45,7 +45,7 @@ let frame = 0;
4545

4646
let mouse = { x: -1000, y: -1000, acc: 0 };
4747

48-
document.onmousemove = e => {
48+
document.onmousemove = (e) => {
4949
mouse.x = e.clientX;
5050
mouse.y = e.clientY;
5151
mouse.acc += e.movementX * e.movementX + e.movementY * e.movementY;
@@ -73,12 +73,12 @@ class Stream {
7373
if (frame % this.speed === 0) {
7474
if (!this.message) {
7575
this.chars.push(
76-
CHARSET[Math.floor(Math.random() * CHARSET.length)]
76+
CHARSET[Math.floor(Math.random() * CHARSET.length)],
7777
);
7878
} else {
7979
// custom message
8080
this.chars.push(
81-
this.message[(frame / this.speed) % this.message.length]
81+
this.message[(frame / this.speed) % this.message.length],
8282
);
8383
}
8484

@@ -156,8 +156,8 @@ const tick = () => {
156156
new Stream(
157157
Math.floor((Math.random() * canvas.width) / CHAR_WIDTH) *
158158
CHAR_WIDTH,
159-
message
160-
)
159+
message,
160+
),
161161
);
162162
}
163163

src/lib/scroll.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const setup = (text: string) => {
88

99
let index = 0;
1010

11-
document.onwheel = e => {
11+
document.onwheel = (e) => {
1212
let random = Math.floor(Math.random() * 7) + 1;
1313

1414
if (e.deltaY < 0 && index > 0) {

src/lib/skills.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
import { CHART_COLOURS, createChart } from "./chart";
22

33
const skills = document.getElementById("skills") as HTMLCanvasElement;
4-
const nav = document.getElementById("fade")!
5-
.children as HTMLCollectionOf<HTMLElement>;
4+
const nav = document.getElementById("fade")!.children as HTMLCollectionOf;
65

76
skills.width = skills.height = Math.min(500, window.innerWidth - 32);
87

9-
const CHARTS: Record<string, number>[] = [
8+
const CHARTS: Record[] = [
109
{
1110
TypeScript: 10,
1211
Rust: 9,
1312
"C/C++": 8,
1413
Go: 7,
1514
Gleam: 6,
16-
Python: 5
15+
Python: 5,
1716
},
1817
{
1918
Astro: 10,
2019
Svelte: 9,
2120
Tailwind: 10,
2221
GraphQL: 9,
2322
tRPC: 8,
24-
PostgreSQL: 9
23+
PostgreSQL: 9,
2524
},
2625
{
2726
"GNU/Linux": 10,
2827
Nix: 9,
2928
Neovim: 10,
3029
Git: 9,
31-
Jira: 7
32-
}
30+
Jira: 7,
31+
},
3332
];
3433

3534
let chart = createChart(skills, CHARTS[0]);
@@ -44,8 +43,8 @@ for (let i = 0; i < nav.length; i++) {
4443
chart.data.datasets = [
4544
{
4645
data: Object.values(CHARTS[i]),
47-
backgroundColor: CHART_COLOURS
48-
}
46+
backgroundColor: CHART_COLOURS,
47+
},
4948
];
5049
chart.update();
5150

src/pages/blog.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const posts = await Astro.glob<Frontmatter>("./blog/*.mdx");
1616
{
1717
posts
1818
.sort((a, b) =>
19-
a.frontmatter.date < b.frontmatter.date ? 1 : -1
19+
a.frontmatter.date < b.frontmatter.date ? 1 : -1,
2020
)
21-
.map(post => (
21+
.map((post) => (
2222
<a
2323
class="mb-4 flex w-[80vw] rounded-lg border-2 border-base p-4 font-bold text-lavender transition-colors hover:border-lavender sm:text-xl md:w-[50vw] lg:text-2xl"
2424
href={post.url}

src/pages/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { COLOURS } from "../lib/colours";
3131
"Teacher",
3232
"Violinist",
3333
"Tennis Player",
34-
"NixOS User"
34+
"NixOS User",
3535
]}
3636
/>
3737
</div>

tailwind.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ module.exports = {
44
theme: {
55
extend: {
66
fontFamily: {
7-
sans: "Victor Mono"
8-
}
9-
}
7+
sans: "Victor Mono",
8+
},
9+
},
1010
},
1111
plugins: [
1212
require("@catppuccin/tailwindcss")({
13-
defaultFlavour: "mocha"
14-
})
15-
]
13+
defaultFlavour: "mocha",
14+
}),
15+
],
1616
};

0 commit comments

Comments
 (0)