Skip to content

Commit 814e897

Browse files
committed
build: astro formatter
Signed-off-by: Adam Setch <[email protected]>
1 parent edd1924 commit 814e897

File tree

15 files changed

+75
-65
lines changed

15 files changed

+75
-65
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
},
66
"editor.defaultFormatter": "biomejs.biome",
77
"[astro]": {
8-
"editor.defaultFormatter": "biomejs.biome"
8+
"editor.defaultFormatter": "astro-build.astro-vscode"
99
}
1010
}

biome.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
"quoteStyle": "single"
2929
}
3030
},
31+
"overrides": [
32+
{
33+
"include": ["*.astro"],
34+
"javascript": {
35+
"formatter": {
36+
"quoteStyle": "double"
37+
}
38+
}
39+
}
40+
],
3141
"json": {
3242
"parser": {
3343
"allowComments": true

src/components/Footer.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
import { Icon } from 'astro-icon/components';
2+
import { Icon } from "astro-icon/components";
33
4-
import { URLs, siteMetadata } from '~/constants';
4+
import { URLs, siteMetadata } from "~/constants";
55
66
const { currentPathname } = Astro.props;
7-
const isHomepage = currentPathname === '/';
7+
const isHomepage = currentPathname === "/";
88
---
99

1010
<div

src/components/GitHubRepo.astro

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
import { Icon } from 'astro-icon/components';
3-
import { Octokit } from 'octokit';
2+
import { Icon } from "astro-icon/components";
3+
import { Octokit } from "octokit";
44
5-
import { URLs, siteMetadata } from '~/constants';
6-
import type { RepoStats } from '~/types';
5+
import { URLs, siteMetadata } from "~/constants";
6+
import type { RepoStats } from "~/types";
77
88
const octokit = new Octokit();
99
1010
const formatCount = (count: number) => {
11-
return new Intl.NumberFormat('en', {
12-
notation: 'compact',
11+
return new Intl.NumberFormat("en", {
12+
notation: "compact",
1313
maximumFractionDigits: 1,
1414
}).format(count);
1515
};
@@ -29,14 +29,14 @@ const loadRepoStats = async (): Promise<RepoStats> => {
2929
return {
3030
forks: formatCount(repository.data.forks_count),
3131
stars: formatCount(repository.data.stargazers_count),
32-
latestReleaseName: latestRelease.data.name?.replace('v', '') ?? '',
32+
latestReleaseName: latestRelease.data.name?.replace("v", "") ?? "",
3333
};
3434
} catch (error) {
35-
console.error('Failed to load repo stats', error);
35+
console.error("Failed to load repo stats", error);
3636
return {
37-
forks: '',
38-
stars: '',
39-
latestReleaseName: '',
37+
forks: "",
38+
stars: "",
39+
latestReleaseName: "",
4040
};
4141
}
4242
};

src/components/GoogleAnalytics.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { siteMetadata } from '~/constants';
2+
import { siteMetadata } from "~/constants";
33
---
44

55
<!-- Google tag (gtag.js) -->

src/components/Hero.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
import { Image } from 'astro:assets';
3-
import Logo from './Logo.astro';
2+
import { Image } from "astro:assets";
3+
import Logo from "./Logo.astro";
44
5-
import { siteMetadata } from '~/constants';
6-
import notifications from '../assets/notifications.png';
7-
import LatestRelease from './LatestRelease.astro';
5+
import { siteMetadata } from "~/constants";
6+
import notifications from "../assets/notifications.png";
7+
import LatestRelease from "./LatestRelease.astro";
88
---
99

1010
<div class="bg-gray-100">

src/components/LatestRelease.astro

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
import { Icon } from 'astro-icon/components';
3-
import { format, parseISO } from 'date-fns';
4-
import { Octokit } from 'octokit';
2+
import { Icon } from "astro-icon/components";
3+
import { format, parseISO } from "date-fns";
4+
import { Octokit } from "octokit";
55
6-
import { URLs, siteMetadata } from '~/constants';
6+
import { URLs, siteMetadata } from "~/constants";
77
import type {
88
DownloadLink,
99
DownloadLinks,
1010
HeroData,
1111
ReleaseAsset,
12-
} from '../types';
12+
} from "../types";
1313
1414
const octokit = new Octokit();
1515
@@ -21,31 +21,31 @@ const getDownloadLinks = (assets: ReleaseAsset[]): DownloadLinks => {
2121
2222
const supportedOSs: DownloadLink[] = [
2323
{
24-
os: 'macOS',
25-
name: 'macOS (Universal)',
24+
os: "macOS",
25+
name: "macOS (Universal)",
2626
url: getAssetLink(/Gitify-\d+.\d+.\d+-universal.dmg/g),
2727
isPrimary: true,
2828
},
2929
{
30-
os: 'Windows',
31-
name: 'Windows',
30+
os: "Windows",
31+
name: "Windows",
3232
url: getAssetLink(/Gitify-Setup-\d+.\d+.\d+.exe/g),
3333
isPrimary: true,
3434
},
3535
{
36-
os: 'Linux',
37-
name: 'Linux (AppImage)',
36+
os: "Linux",
37+
name: "Linux (AppImage)",
3838
url: getAssetLink(/Gitify-\d+.\d+.\d+.AppImage/g),
3939
isPrimary: true,
4040
},
4141
{
42-
os: 'Linux',
43-
name: 'Linux (deb)',
42+
os: "Linux",
43+
name: "Linux (deb)",
4444
url: getAssetLink(/gitify_\d+.\d+.\d+_amd64.deb/g),
4545
},
4646
{
47-
os: 'Linux',
48-
name: 'Linux (rpm)',
47+
os: "Linux",
48+
name: "Linux (rpm)",
4949
url: getAssetLink(/gitify-\d+.\d+.\d+.x86_64.rpm/g),
5050
},
5151
];
@@ -79,17 +79,17 @@ const loadInitialData = async (): Promise<HeroData> => {
7979
downloadLinks,
8080
version: latestRelease.data.name,
8181
releaseDate: latestRelease.data.published_at
82-
? format(latestRelease.data.published_at, 'dd/MM/yyyy')
83-
: '',
82+
? format(latestRelease.data.published_at, "dd/MM/yyyy")
83+
: "",
8484
};
8585
} catch (error) {
8686
return {
8787
downloadLinks: {
8888
alt: [],
8989
primary: [],
9090
},
91-
version: '',
92-
releaseDate: '',
91+
version: "",
92+
releaseDate: "",
9393
};
9494
}
9595
};

src/components/Logo.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export interface Props {
44
className?: string;
55
}
66
7-
const LIGHT_GRADIENT_START = '#CCCCCC';
8-
const LIGHT_GRADIENT_END = '#FFFFFF';
7+
const LIGHT_GRADIENT_START = "#CCCCCC";
8+
const LIGHT_GRADIENT_END = "#FFFFFF";
99
10-
const DARK_GRADIENT_START = '#22283B';
11-
const DARK_GRADIENT_END = '#555B6E';
10+
const DARK_GRADIENT_START = "#22283B";
11+
const DARK_GRADIENT_END = "#555B6E";
1212
13-
const { isDark = false, className = '' } = Astro.props;
13+
const { isDark = false, className = "" } = Astro.props;
1414
---
1515

1616
<svg

src/components/Navbar.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
import { siteMetadata } from '~/constants';
3-
import GitHubRepo from './GitHubRepo.astro';
4-
import Logo from './Logo.astro';
2+
import { siteMetadata } from "~/constants";
3+
import GitHubRepo from "./GitHubRepo.astro";
4+
import Logo from "./Logo.astro";
55
66
const { currentPathname } = Astro.props;
7-
const isHomepage = currentPathname === '/';
7+
const isHomepage = currentPathname === "/";
88
---
99

1010
<nav class:list={["py-8 px-8", isHomepage && "bg-gray-100"]}>

src/layouts/Layout.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
import Footer from '../components/Footer.astro';
3-
import GoogleAnalytics from '../components/GoogleAnalytics.astro';
4-
import Navbar from '../components/Navbar.astro';
5-
import '../styles/app.css';
2+
import Footer from "../components/Footer.astro";
3+
import GoogleAnalytics from "../components/GoogleAnalytics.astro";
4+
import Navbar from "../components/Navbar.astro";
5+
import "../styles/app.css";
66
7-
import { siteMetadata } from '../constants';
7+
import { siteMetadata } from "../constants";
88
99
export interface Props {
1010
title: string;

0 commit comments

Comments
 (0)