Skip to content

Commit 59fdea7

Browse files
committed
lint
1 parent a440ac4 commit 59fdea7

File tree

10 files changed

+87
-36
lines changed

10 files changed

+87
-36
lines changed

src/components/Footer.astro

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ const currentYear = new Date().getFullYear();
55
<footer role="contentinfo">
66
<center>
77
<hr />
8-
<p><small{currentYear} cb341. Licensed under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener noreferrer">CC BY 4.0</a>.</small></p>
8+
<p>
9+
<small
10+
{currentYear} cb341. Licensed under <a
11+
href="https://creativecommons.org/licenses/by/4.0/"
12+
target="_blank"
13+
rel="noopener noreferrer">CC BY 4.0</a
14+
>.</small>
15+
</p>
916

1017
<a
1118
href="https://github.com/cb341"

src/components/NavLink.astro

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ interface Props {
44
external?: boolean;
55
target?: string;
66
rel?: string;
7-
'aria-label'?: string;
7+
"aria-label"?: string;
88
}
99
10-
const { href, external = false, target, rel, 'aria-label': ariaLabel } = Astro.props;
10+
const {
11+
href,
12+
external = false,
13+
target,
14+
rel,
15+
"aria-label": ariaLabel,
16+
} = Astro.props;
1117
1218
let isActive = !external && Astro.url.pathname.startsWith(href);
1319
if (isActive && href === "/" && Astro.url.pathname !== "/") {
@@ -17,11 +23,19 @@ if (isActive && href === "/" && Astro.url.pathname !== "/") {
1723
const linkProps = {
1824
href,
1925
...(external && { target, rel }),
20-
...(ariaLabel && { 'aria-label': ariaLabel }),
21-
...(isActive && !external && { 'aria-current': 'page' as const }),
26+
...(ariaLabel && { "aria-label": ariaLabel }),
27+
...(isActive && !external && { "aria-current": "page" as const }),
2228
};
2329
---
2430

2531
<a {...linkProps}>
26-
{isActive && !external ? <b><slot /></b> : <slot />}
32+
{
33+
isActive && !external ? (
34+
<b>
35+
<slot />
36+
</b>
37+
) : (
38+
<slot />
39+
)
40+
}
2741
</a>

src/content/blog/editor-journey.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "My Editor Journey"
33
publishedAt: 2025-10-25
44
description: "My journey through text editors, from Atom to LazyVim, with some thoughts on AI coding assistants."
5-
tags: ["neovim","ai","workflow"]
5+
tags: ["neovim", "ai", "workflow"]
66
---
77

88
# My Editor Journey

src/content/blog/hackts-design.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ I chose Rails with custom Sass stylesheets because of the abundance of unique st
1414
As you can see in the box model view, the layout contains many irregular spacings, varying element sizes, and non-uniform alignments. These characteristics made it difficult to implement using flexbox or grid with simple gaps, margins, and paddings, and required precise, element by element positioning.
1515

1616
![hackts.ch homepage with debug rendering](../../assets/blog/hackts_debug.webp)
17-
*A draft of the hackts.ch page with box model inspection, showing the irregular spacing and alignment requirements.*
17+
_A draft of the hackts.ch page with box model inspection, showing the irregular spacing and alignment requirements._
1818

1919
I also experimented with Figma to code tools such as [Builder.io’s Figma plugin](https://www.builder.io/c/docs/figma-to-builder) but the results were disappointing. The generated markup was verbose and composed of inline styles, with font styling defined multiple times instead of integrating with the existing font definitions. There was no clear component structure or hierarchy, which made the output unpleasant to read.
2020

2121
## Retrospective Approaches
2222

2323
Looking back, several methods might have eased the process:
2424

25-
- Rendering sections as images with defined clickable areas using [`<area>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/area) elements
26-
- Using background images with text overlays
27-
- Exporting directly from Figma as SVGs to keep both vector shapes and text, applying CSS classes to [SVG elements](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/style) for consistent styling ([MDN: Styling SVG with CSS](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_and_CSS))
28-
- Adding overlays for pixel accurate alignment adjustments
25+
- Rendering sections as images with defined clickable areas using [`<area>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/area) elements
26+
- Using background images with text overlays
27+
- Exporting directly from Figma as SVGs to keep both vector shapes and text, applying CSS classes to [SVG elements](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/style) for consistent styling ([MDN: Styling SVG with CSS](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_and_CSS))
28+
- Adding overlays for pixel accurate alignment adjustments
2929

3030
While using images and clickable areas may allow for faster development, it compromises accessibility, responsiveness, and maintainability, ultimately leading to a poorer user experience and not aligning with best practices in web development.
3131

src/content/blog/local-zsh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Some rely entirely on Docker Compose.
1212
Defining global aliases for commands such as `rspec` or `rubocop` can quickly cause conflicts between projects:
1313

1414
```bash
15-
alias rubocop='docker compose exec app bundle exec rubocop -a'
15+
alias rubocop='docker compose exec app bundle exec rubocop -a'
1616
```
1717

1818
Creating complex Bash functions to detect the correct environment is possible, but usually not worth the time.

src/layouts/BaseLayout.astro

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,28 @@ const structuredData = {
153153
overflow-x: auto;
154154
}
155155

156-
h1, h2, h3 {
156+
h1,
157+
h2,
158+
h3 {
157159
line-height: 1.2;
158160
}
159161

160-
table td, table th {
162+
table td,
163+
table th {
161164
border-bottom: 1px solid #ddd;
162165
}
163166

164167
@media (max-width: 768px) {
165-
.mobile-table thead { display: none; }
166-
.mobile-table tr { display: block; border-bottom: 1px solid #ddd }
168+
.mobile-table thead {
169+
display: none;
170+
}
171+
.mobile-table tr {
172+
display: block;
173+
border-bottom: 1px solid #ddd;
174+
}
167175
.mobile-table td {
168-
display: block; border-bottom: none;
176+
display: block;
177+
border-bottom: none;
169178
}
170179
.mobile-table td:before {
171180
content: attr(data-label) ": ";
@@ -178,7 +187,11 @@ const structuredData = {
178187
<a href="#main-content" class="skip-nav">Skip to main content</a>
179188

180189
<header role="banner">
181-
<h1><center><NavLink href="/" aria-label="CB341.DEV - Home">CB341.DEV</NavLink></center></h1>
190+
<h1>
191+
<center
192+
><NavLink href="/" aria-label="CB341.DEV - Home">CB341.DEV</NavLink
193+
></center>
194+
</h1>
182195
<nav role="navigation" aria-label="Main navigation">
183196
<center>
184197
<NavLink href="/">Home</NavLink>
@@ -196,11 +209,29 @@ const structuredData = {
196209
</nav>
197210
<nav class="social-nav" role="navigation" aria-label="Social media links">
198211
<center>
199-
<NavLink href="https://www.codewars.com/users/cb341" external target="_blank" rel="noopener noreferrer" aria-label="Codewars profile (opens in new tab)">Codewars</NavLink>
212+
<NavLink
213+
href="https://www.codewars.com/users/cb341"
214+
external
215+
target="_blank"
216+
rel="noopener noreferrer"
217+
aria-label="Codewars profile (opens in new tab)">Codewars</NavLink
218+
>
200219
|
201-
<NavLink href="https://www.linkedin.com/in/daniel-bengl" external target="_blank" rel="noopener noreferrer" aria-label="LinkedIn profile (opens in new tab)">LinkedIn</NavLink>
220+
<NavLink
221+
href="https://www.linkedin.com/in/daniel-bengl"
222+
external
223+
target="_blank"
224+
rel="noopener noreferrer"
225+
aria-label="LinkedIn profile (opens in new tab)">LinkedIn</NavLink
226+
>
202227
|
203-
<NavLink href="https://github.com/cb341" external target="_blank" rel="noopener noreferrer" aria-label="GitHub profile (opens in new tab)">GitHub</NavLink>
228+
<NavLink
229+
href="https://github.com/cb341"
230+
external
231+
target="_blank"
232+
rel="noopener noreferrer"
233+
aria-label="GitHub profile (opens in new tab)">GitHub</NavLink
234+
>
204235
</center>
205236
</nav>
206237
</header>
@@ -219,10 +250,12 @@ const structuredData = {
219250
if (table.hasAttribute("data-responsive")) return;
220251
table.setAttribute("data-responsive", "true");
221252

222-
const headers = Array.from(table.querySelectorAll("thead th")).map(th => th.textContent?.trim() || "");
223-
253+
const headers = Array.from(table.querySelectorAll("thead th")).map(
254+
(th) => th.textContent?.trim() || "",
255+
);
256+
224257
table.classList.add("mobile-table");
225-
258+
226259
const rows = table.querySelectorAll("tbody tr");
227260
rows.forEach((row) => {
228261
const cells = row.querySelectorAll("td");

src/pages/about.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ import BaseLayout from "../layouts/BaseLayout.astro";
6767

6868
<ul>
6969
<li>
70-
<strong>Coding</strong> - Working on personal projects and exploring new
71-
technologies
70+
<strong>Coding</strong> - Working on personal projects and exploring new technologies
7271
</li>
7372
<li>
7473
<strong>Reading about coding</strong> - Staying up-to-date with development

src/pages/blog/tags/[...tag].astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export async function getStaticPaths() {
2323
const { tag } = Astro.params;
2424
const { taggedBlogPosts } = Astro.props;
2525
---
26+
2627
<BaseLayout title={`Posts tagged with ${tag}`}>
2728
<h1>Posts tagged with "{tag}"</h1>
2829

src/pages/rss.xml.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import rss from '@astrojs/rss';
1+
import rss from "@astrojs/rss";
22
import { getCollection } from "astro:content";
3-
import sanitizeHtml from 'sanitize-html';
4-
import MarkdownIt from 'markdown-it';
3+
import sanitizeHtml from "sanitize-html";
4+
import MarkdownIt from "markdown-it";
55
const parser = new MarkdownIt();
66

77
export async function GET(context) {
@@ -15,7 +15,7 @@ export async function GET(context) {
1515
description: post.data.description,
1616
link: `/blog/${post.slug}/`,
1717
content: sanitizeHtml(parser.render(post.body), {
18-
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img'])
18+
allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]),
1919
}),
2020
categories: post.data.tags || [],
2121
author: "cb341",
@@ -32,7 +32,7 @@ export async function GET(context) {
3232
<license>MIT</license>
3333
`,
3434
};
35-
})
35+
}),
3636
);
3737

3838
return rss({

src/utils/dateHelpers.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
* @returns Formatted date string in dd.mm.yyyy format
55
*/
66
export function formatDate(date: Date | string | number): string {
7-
return new Date(date)
8-
.toLocaleDateString("en-GB")
9-
.split("/")
10-
.join(".");
7+
return new Date(date).toLocaleDateString("en-GB").split("/").join(".");
118
}

0 commit comments

Comments
 (0)