Skip to content

Commit c2153b8

Browse files
committed
feat: added pretier rc file for styling consistency
1 parent 093258b commit c2153b8

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

src/lib/utils.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { DEFAULT_CONFIGURATION } from "./constants";
2-
import type { CollectionEntry } from "astro:content";
1+
import { DEFAULT_CONFIGURATION } from './constants';
2+
import type { CollectionEntry } from 'astro:content';
33

44
export const formatDate = (date: Date) => {
5-
const formatter = new Intl.DateTimeFormat("en-US", {
6-
year: "numeric",
7-
month: "short",
8-
day: "numeric",
9-
timeZone: "UTC", // Default to UTC to prevent timezone issues
5+
const formatter = new Intl.DateTimeFormat('en-US', {
6+
year: 'numeric',
7+
month: 'short',
8+
day: 'numeric',
9+
timeZone: 'UTC', // Default to UTC to prevent timezone issues
1010
});
1111

1212
// Ensure we're parsing the date correctly
@@ -16,17 +16,17 @@ export const formatDate = (date: Date) => {
1616
export const generateAbsoluteUrl = (path: string) =>
1717
DEFAULT_CONFIGURATION.baseUrl.concat(path);
1818

19-
export const isDevelopment = () => import.meta.env.MODE === "development";
19+
export const isDevelopment = () => import.meta.env.MODE === 'development';
2020

2121
export const includeDraft = (draft: boolean) => {
2222
if (isDevelopment()) return true;
2323
return draft !== true;
2424
};
2525

26-
export const sortJobsByDate = (jobs: CollectionEntry<"jobs">[]) => {
26+
export const sortJobsByDate = (jobs: CollectionEntry<'jobs'>[]) => {
2727
// Convert "Now" to current year, otherwise returns the year as is
28-
const getEndYear = (job: CollectionEntry<"jobs">) =>
29-
job.data.to === "Now" ? new Date().getFullYear() : job.data.to;
28+
const getEndYear = (job: CollectionEntry<'jobs'>) =>
29+
job.data.to === 'Now' ? new Date().getFullYear() : job.data.to;
3030

3131
return jobs.sort((current, next) => {
3232
// Compare end years first, then fall back to start years if end years are equal

src/pages/index.astro

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
import { getEntry, getCollection, render } from "astro:content";
3-
import BaseLayout from "@/layouts/BaseLayout.astro";
4-
import Container from "@/components/Container.astro";
5-
import Author from "@/components/ui/Author.astro";
6-
import { DEFAULT_CONFIGURATION } from "@/lib/constants";
7-
import WorkExperience from "@/components/ui/WorkExperience.astro";
8-
import Talk from "@/components/ui/Talk.astro";
9-
import { sortJobsByDate } from "@/lib/utils";
2+
import { getEntry, getCollection, render } from 'astro:content';
3+
import BaseLayout from '@/layouts/BaseLayout.astro';
4+
import Container from '@/components/Container.astro';
5+
import Author from '@/components/ui/Author.astro';
6+
import { DEFAULT_CONFIGURATION } from '@/lib/constants';
7+
import WorkExperience from '@/components/ui/WorkExperience.astro';
8+
import Talk from '@/components/ui/Talk.astro';
9+
import { sortJobsByDate } from '@/lib/utils';
1010
11-
const entry = await getEntry("pages", "homepage");
11+
const entry = await getEntry('pages', 'homepage');
1212
const { Content } = await render(entry);
1313
14-
const links = await getCollection("links");
15-
const jobs = await getCollection("jobs");
14+
const links = await getCollection('links');
15+
const jobs = await getCollection('jobs');
1616
const sortedJobs = sortJobsByDate(jobs);
17-
const talks = await getCollection("talks");
17+
const talks = await getCollection('talks');
1818
---
1919

2020
<BaseLayout seo={entry.data.seo}>

0 commit comments

Comments
 (0)