Skip to content

Commit

Permalink
Fine-tune Prettier configuration 💅.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Apr 15, 2024
1 parent 99009e6 commit 8660a0b
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 1,074 deletions.
1,137 changes: 89 additions & 1,048 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.12",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"tailwindcss": "^3.4.3"
},
"overrides": {
Expand All @@ -55,11 +57,12 @@
}
},
"prettier": {
"arrowParens": "always",
"astroAllowShorthand": true,
"printWidth": 80,
"embeddedLanguageFormatting": "off",
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
"plugins": [
"prettier-plugin-astro"
]
}
}
2 changes: 1 addition & 1 deletion src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const navigationLinks = NAVIGATION
>
{t(link.title)}
</HeaderLink>
)
),
)
}
<div class="flex justify-center items-center gap-4">
Expand Down
2 changes: 1 addition & 1 deletion src/components/solidjs/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function ThemeSwitcher() {

createEffect(() => {
document.documentElement.classList.remove(
getTheme() === 'dark' ? 'light' : 'dark'
getTheme() === 'dark' ? 'light' : 'dark',
)
document.documentElement.classList.add(getTheme())
localStorage.setItem('theme', getTheme())
Expand Down
14 changes: 7 additions & 7 deletions src/content/authors/default.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ gitlab: https://gitlab.com/gmarty
github: https://github.com/gmarty
---

Guillaume (pronounced */ghee-yom/*) has been working in the tech industry for two decades. He was previously as a software engineer at **Mozilla** on the Firefox OS, and an engineering manager and coach at **Twitter**.
Guillaume (pronounced _/ghee-yom/_) has been working in the tech industry for two decades. He was previously as a software engineer at **Mozilla** on the Firefox OS, and an engineering manager and coach at **Twitter**.

He's passionate about web technologies and contributes regularly to open source projects (check the [Gitlab](https://gitlab.com/gmarty) and [Github](https://github.com/gmarty) accounts).

He's also fascinated by video games, animation, history, and, as a Japanese speaker, foreign languages.

Find Guillaume online:

* Mastodon: <a rel="me" href="https://indieweb.social/@gmarty">@gmarty (@indieweb.social)</a>
* Gitlab: [gmarty](https://gitlab.com/gmarty)
* Github: [gmarty](https://github.com/gmarty)
* Linkedin: [gmarty](https://www.linkedin.com/in/gmarty)
* Pixelfed: [gmarty](https://pixelfed.social/gmarty)
* [vCard](/gmarty.vcf)
- Mastodon: <a rel="me" href="https://indieweb.social/@gmarty">@gmarty (@indieweb.social)</a>
- Gitlab: [gmarty](https://gitlab.com/gmarty)
- Github: [gmarty](https://github.com/gmarty)
- Linkedin: [gmarty](https://www.linkedin.com/in/gmarty)
- Pixelfed: [gmarty](https://pixelfed.social/gmarty)
- [vCard](/gmarty.vcf)
2 changes: 1 addition & 1 deletion src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { CollectionEntry } from 'astro:content'
* @returns Collection of blog posts sorted by date
*/
export const sortBlogPosts = (
posts: CollectionEntry<'blog'>[] | null
posts: CollectionEntry<'blog'>[] | null,
): CollectionEntry<'blog'>[] => {
if (!posts) return []
return posts.sort((a, b) => {
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getLangFromUrl(url: URL) {
export function useTranslations(lang: keyof typeof ui = defaultLang) {
return function t(
key: keyof (typeof ui)[typeof defaultLang],
tags?: Record<string, string>
tags?: Record<string, string>,
) {
const translation = ui[lang][key] || ui[defaultLang][key]

Expand All @@ -24,7 +24,7 @@ export function useTranslations(lang: keyof typeof ui = defaultLang) {
// where in the translation file we have: 'Toggle {darkMode}'
return (ui[lang][key] || ui[defaultLang][key]).replace(
/\{(\w+)\}/g,
(_, match) => tags?.[match] || ''
(_, match) => tags?.[match] || '',
)
}
}
2 changes: 1 addition & 1 deletion src/layouts/ListWithTagsLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const isBlogPage = Astro.url.pathname.startsWith('/posts')
</div>
</article>
</li>
)
),
)
}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/PostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ interface Props {
const { post, next, prev } = Astro.props as Props
const authors: CollectionEntry<'authors'>[] = await getEntries(
post.data.authors
post.data.authors,
)
const tags: CollectionEntry<'tags'>[] = await getEntries(post.data.tags)
const related: CollectionEntry<'blog'>[] = await getEntries(
post.data.related
post.data.related,
).then(sortBlogPosts)
const articleOgDetails = {
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/SimplePostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ interface Props {
const { post, next, prev } = Astro.props as Props
const authors: CollectionEntry<'authors'>[] = await getEntries(
post.data.authors
post.data.authors,
)
const tags: CollectionEntry<'tags'>[] = await getEntries(post.data.tags)
const related: CollectionEntry<'blog'>[] = await getEntries(
post.data.related
post.data.related,
).then(sortBlogPosts)
const articleOgDetails = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/apps.astro
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const data = [
{imgType}
{href}
/>
)
),
)
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/meetups.astro
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const data = [
{imgType}
{href}
/>
)
),
)
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tags/[slug]/[...page].astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getStaticPaths = (async ({ paginate }) => {
return tags.flatMap((entry) => {
const tagPosts = posts.filter((post) =>
post.data.tags.some(({ slug }) => slug === entry.slug)
post.data.tags.some(({ slug }) => slug === entry.slug),
)
return paginate(tagPosts, {
pageSize: ITEMS_PER_PAGE,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/talks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const data = [
data.map(
(
{ title, date, location, description, imgSrc, imgType, href },
index
index,
) => (
<Card
{index}
Expand All @@ -97,7 +97,7 @@ const data = [
{imgType}
{href}
/>
)
),
)
}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ body {
/* https://stackoverflow.com/questions/61083813/how-to-avoid-internal-autofill-selected-style-to-be-applied */
input:-webkit-autofill,
input:-webkit-autofill:focus {
transition: background-color 600000s 0s, color 600000s 0s;
transition:
background-color 600000s 0s,
color 600000s 0s;
}

lite-youtube {
Expand Down

0 comments on commit 8660a0b

Please sign in to comment.