Skip to content

Commit fffaaae

Browse files
committed
Update prettier rules
1 parent cef63bf commit fffaaae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1752
-1500
lines changed

.astro/icon.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
// 6339060a2f9d69e8b84a4b7dc1714c2937d6db46d28442485b0129d1ad20d45b
33

44
declare module 'virtual:astro-icon' {
5-
export type Icon = 'arc' | 'chatgpt' | 'figma' | 'notion' | 'obsidian' | 'vscode'
5+
export type Icon =
6+
| 'arc'
7+
| 'chatgpt'
8+
| 'figma'
9+
| 'notion'
10+
| 'obsidian'
11+
| 'vscode';
612
}

bun.lockb

1.9 KB
Binary file not shown.

index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Hello via Bun!');

package.json

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,58 @@
11
{
2-
"name": "astro-blog",
3-
"type": "module",
4-
"version": "0.0.1",
5-
"scripts": {
6-
"dev": "astro check --watch & astro dev",
7-
"start": "astro dev",
8-
"build": "astro check && astro build",
9-
"preview": "astro preview",
10-
"astro": "astro",
11-
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,svelte,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,svelte,astro}\""
12-
},
13-
"dependencies": {
14-
"@astrojs/check": "^0.5.10",
15-
"@astrojs/mdx": "^3.1.3",
16-
"@astrojs/rss": "^4.0.7",
17-
"@astrojs/sitemap": "^3.1.6",
18-
"@astrojs/tailwind": "^5.1.0",
19-
"@astrojs/vercel": "^7.7.2",
20-
"@fontsource/iosevka": "^5.0.11",
21-
"@fontsource/jetbrains-mono": "^5.0.20",
22-
"@fontsource/source-sans-pro": "^5.0.8",
23-
"@vercel/analytics": "^1.3.1",
24-
"astro": "^4.13.0",
25-
"astro-expressive-code": "^0.33.5",
26-
"astro-icon": "^1.1.0",
27-
"clsx": "^2.1.1",
28-
"mdast-util-to-string": "^4.0.0",
29-
"punycode": "^2.3.1",
30-
"reading-time": "^1.5.0",
31-
"rehype-external-links": "^3.0.0",
32-
"rehype-mathjax": "^6.0.0",
33-
"remark-math": "^6.0.0",
34-
"remark-smartypants": "^3.0.2",
35-
"remark-unwrap-images": "^4.0.0",
36-
"sharp": "^0.33.4",
37-
"tailwind-merge": "^2.4.0",
38-
"tailwindcss": "^3.4.7",
39-
"typescript": "^5.5.4"
40-
},
41-
"devDependencies": {
42-
"@tailwindcss/aspect-ratio": "^0.4.2",
43-
"@tailwindcss/typography": "^0.5.13",
44-
"@typescript-eslint/parser": "^7.18.0",
45-
"eslint": "^8.57.0",
46-
"eslint-plugin-astro": "^0.31.4",
47-
"eslint-plugin-jsx-a11y": "^6.9.0",
48-
"prettier": "^3.3.3",
49-
"prettier-config-standard": "^7.0.0",
50-
"prettier-plugin-astro": "^0.13.0",
51-
"prettier-plugin-tailwindcss": "^0.5.14"
52-
}
53-
}
2+
"name": "astro-blog",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro check --watch & astro dev",
7+
"start": "astro dev",
8+
"build": "astro check && astro build",
9+
"preview": "astro preview",
10+
"astro": "astro",
11+
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,svelte,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,svelte,astro}\""
12+
},
13+
"dependencies": {
14+
"@astrojs/check": "^0.5.10",
15+
"@astrojs/mdx": "^3.1.3",
16+
"@astrojs/rss": "^4.0.7",
17+
"@astrojs/sitemap": "^3.1.6",
18+
"@astrojs/tailwind": "^5.1.0",
19+
"@astrojs/vercel": "^7.7.2",
20+
"@fontsource/iosevka": "^5.0.11",
21+
"@fontsource/jetbrains-mono": "^5.0.20",
22+
"@fontsource/source-sans-pro": "^5.0.8",
23+
"@vercel/analytics": "^1.3.1",
24+
"astro": "^4.13.0",
25+
"astro-expressive-code": "^0.33.5",
26+
"astro-icon": "^1.1.0",
27+
"clsx": "^2.1.1",
28+
"mdast-util-to-string": "^4.0.0",
29+
"punycode": "^2.3.1",
30+
"reading-time": "^1.5.0",
31+
"rehype-external-links": "^3.0.0",
32+
"rehype-mathjax": "^6.0.0",
33+
"remark-math": "^6.0.0",
34+
"remark-smartypants": "^3.0.2",
35+
"remark-unwrap-images": "^4.0.0",
36+
"sharp": "^0.33.4",
37+
"tailwind-merge": "^2.4.0",
38+
"tailwindcss": "^3.4.7",
39+
"typescript": "^5.5.4"
40+
},
41+
"devDependencies": {
42+
"@tailwindcss/aspect-ratio": "^0.4.2",
43+
"@tailwindcss/typography": "^0.5.13",
44+
"@typescript-eslint/parser": "^7.18.0",
45+
"eslint": "^8.57.0",
46+
"eslint-plugin-astro": "^0.31.4",
47+
"eslint-plugin-jsx-a11y": "^6.9.0",
48+
"prettier": "^3.3.3",
49+
"prettier-config-standard": "^7.0.0",
50+
"prettier-plugin-astro": "^0.13.0",
51+
"prettier-plugin-tailwindcss": "^0.5.14",
52+
"@types/bun": "latest"
53+
},
54+
"module": "index.ts",
55+
"peerDependencies": {
56+
"typescript": "^5.0.0"
57+
}
58+
}

prettier.config.cjs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
/** @type {import("prettier").Config} */
22
module.exports = {
3-
...require('prettier-config-standard'),
4-
pluginSearchDirs: [__dirname],
5-
plugins: ['prettier-plugin-astro', 'prettier-plugin-tailwindcss'],
6-
overrides: [
7-
{
8-
files: '*.astro',
9-
options: {
10-
parser: 'astro'
11-
}
12-
}
13-
],
14-
useTabs: true,
15-
singleQuote: true,
16-
trailingComma: 'none',
17-
printWidth: 100
18-
}
3+
...require('prettier-config-standard'),
4+
pluginSearchDirs: [__dirname],
5+
plugins: ['prettier-plugin-astro', 'prettier-plugin-tailwindcss'],
6+
overrides: [
7+
{
8+
files: '*.astro',
9+
options: {
10+
parser: 'astro'
11+
}
12+
}
13+
],
14+
semi: true
15+
};

src/components/BaseHead.astro

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
---
22
// Import the global.css file here so that it is included on
33
// all pages through the use of the <BaseHead /> component.
4-
import '../styles/app.css'
4+
import '../styles/app.css';
55
6-
import type { SiteMeta } from '@/types'
7-
import { siteConfig } from '@/site-config'
6+
import type { SiteMeta } from '@/types';
7+
import { siteConfig } from '@/site-config';
88
9-
type Props = SiteMeta
9+
type Props = SiteMeta;
1010
11-
const { articleDate, description, ogImage, title } = Astro.props
11+
const { articleDate, description, ogImage, title } = Astro.props;
1212
13-
const titleSeparator = ''
14-
const siteTitle = `${title} ${titleSeparator} ${siteConfig.title}`
15-
const canonicalURL = new URL(Astro.url.pathname, Astro.site)
16-
const socialImageURL = new URL(ogImage ? ogImage : '/social-card.png', Astro.url).href
13+
const titleSeparator = '';
14+
const siteTitle = `${title} ${titleSeparator} ${siteConfig.title}`;
15+
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
16+
const socialImageURL = new URL(
17+
ogImage ? ogImage : '/social-card.png',
18+
Astro.url
19+
).href;
1720
---
1821

1922
<meta charset='utf-8' />
20-
<meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' />
23+
<meta
24+
content='width=device-width, initial-scale=1.0, shrink-to-fit=no'
25+
name='viewport'
26+
/>
2127
<meta content='IE=edge' http-equiv='X-UA-Compatible' />
2228
<title>{siteTitle}</title>
2329

@@ -46,12 +52,12 @@ const socialImageURL = new URL(ogImage ? ogImage : '/social-card.png', Astro.url
4652
<meta content='1200' property='og:image:width' />
4753
<meta content='630' property='og:image:height' />
4854
{
49-
articleDate && (
50-
<>
51-
<meta content={siteConfig.author} property='article:author' />
52-
<meta content={articleDate} property='article:published_time' />
53-
</>
54-
)
55+
articleDate && (
56+
<>
57+
<meta content={siteConfig.author} property='article:author' />
58+
<meta content={articleDate} property='article:published_time' />
59+
</>
60+
)
5561
}
5662

5763
{/* Twitter */}
@@ -65,6 +71,11 @@ const socialImageURL = new URL(ogImage ? ogImage : '/social-card.png', Astro.url
6571
<link href='/sitemap-index.xml' rel='sitemap' />
6672

6773
{/* RSS auto-discovery */}
68-
<link href='/rss.xml' rel='alternate' title={siteConfig.title} type='application/rss+xml' />
74+
<link
75+
href='/rss.xml'
76+
rel='alternate'
77+
title={siteConfig.title}
78+
type='application/rss+xml'
79+
/>
6980

7081
<meta content={Astro.generator} name='generator' />

src/components/BlogImage.astro

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
interface Props {
3-
imagePath: string
4-
altText?: string
5-
fullWidth?: boolean
3+
imagePath: string;
4+
altText?: string;
5+
fullWidth?: boolean;
66
}
77
8-
const { imagePath, altText = '', fullWidth = false } = Astro.props
8+
const { imagePath, altText = '', fullWidth = false } = Astro.props;
99
---
1010

1111
<figure class='sm:text-center'>
12-
<img
13-
src={imagePath}
14-
alt={altText}
15-
class:list={[fullWidth ? '' : 'sm:size-1/2', 'mx-auto', 'drop-shadow']}
16-
/>
17-
{
18-
altText && (
19-
<figcaption>
20-
<span class='font-extrabold'>Fig.</span> &nbsp; {altText}
21-
</figcaption>
22-
)
23-
}
12+
<img
13+
src={imagePath}
14+
alt={altText}
15+
class:list={[fullWidth ? '' : 'sm:size-1/2', 'mx-auto', 'drop-shadow']}
16+
/>
17+
{
18+
altText && (
19+
<figcaption>
20+
<span class='font-extrabold'>Fig.</span> &nbsp; {altText}
21+
</figcaption>
22+
)
23+
}
2424
</figure>

src/components/Button.astro

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
---
2-
import { cn } from '@/utils'
3-
const { as: Tag = 'a', class: className, title, href, style = 'button' } = Astro.props
2+
import { cn } from '@/utils';
3+
const {
4+
as: Tag = 'a',
5+
class: className,
6+
title,
7+
href,
8+
style = 'button'
9+
} = Astro.props;
410
---
511

612
<Tag
7-
class={cn(
8-
'inline-flex items-center gap-x-1 rounded-lg bg-primary-foreground border border-border px-2 py-1 text-sm transition-all hover:bg-input',
9-
className,
10-
!href && 'cursor-default',
11-
style === 'pill' && 'rounded-xl'
12-
)}
13-
href={href}
14-
data-astro-prefetch
13+
class={cn(
14+
'inline-flex items-center gap-x-1 rounded-lg bg-primary-foreground border border-border px-2 py-1 text-sm transition-all hover:bg-input',
15+
className,
16+
!href && 'cursor-default',
17+
style === 'pill' && 'rounded-xl'
18+
)}
19+
href={href}
20+
data-astro-prefetch
1521
>
16-
<slot name='icon-before' />
17-
<p>{title}</p>
18-
<slot name='icon-after' />
22+
<slot name='icon-before' />
23+
<p>{title}</p>
24+
<slot name='icon-after' />
1925
</Tag>

0 commit comments

Comments
 (0)