Skip to content

Commit

Permalink
Merge pull request #5 from tuatmcc/feat/lint
Browse files Browse the repository at this point in the history
add lint fmt scripts
  • Loading branch information
OJII3 authored Aug 11, 2024
2 parents b3dafef + a9186da commit ad5d884
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 124 deletions.
7 changes: 1 addition & 6 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@ import tailwind from "@astrojs/tailwind";
// https://astro.build/config
export default defineConfig({
site: "https://example.com",
integrations: [
mdx(),
sitemap(),
tailwind(),
react(),
],
integrations: [mdx(), sitemap(), tailwind(), react()],
});
42 changes: 21 additions & 21 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignore": [".vscode"]
}
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignore": [".vscode"]
}
}
58 changes: 30 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
{
"name": "tuatmcc-com-mk3",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.9.2",
"@astrojs/mdx": "^3.1.3",
"@astrojs/react": "^3.6.2",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0",
"@biomejs/biome": "^1.8.3",
"@fontsource-variable/jetbrains-mono": "^5.0.21",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.13.1",
"pagefind": "^1.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4"
}
"name": "tuatmcc-com-mk3",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"lint": "biome check .",
"fmt": "biome check . --write"
},
"dependencies": {
"@astrojs/check": "^0.9.2",
"@astrojs/mdx": "^3.1.3",
"@astrojs/react": "^3.6.2",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0",
"@biomejs/biome": "^1.8.3",
"@fontsource-variable/jetbrains-mono": "^5.0.21",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.13.1",
"pagefind": "^1.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4"
}
}
28 changes: 14 additions & 14 deletions src/components/BaseHead.astro
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
// Import the global.css file here so that it is included on
// all pages through the use of the <BaseHead /> component.
import '../styles/global.css';
import "../styles/global.css";
export interface Props {
title: string;
description?: string;
path: string;
pagefind: boolean;
og: {
enabled: boolean;
image?: URL;
width?: number;
height?: number;
type?: "article" | "website";
}
};
title: string;
description?: string;
path: string;
pagefind: boolean;
og: {
enabled: boolean;
image?: URL;
width?: number;
height?: number;
type?: "article" | "website";
};
}
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const { title, description, og } = Astro.props;
const image = og.image ?? new URL('/images/og-image.jpg', Astro.url);
const image = og.image ?? new URL("/images/og-image.jpg", Astro.url);
---

<!-- Global Metadata -->
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import HeaderLink from './HeaderLink.astro';
import { SITE_TITLE } from '../consts';
import { SITE_TITLE } from "../consts";
import HeaderLink from "./HeaderLink.astro";
---

<header>
Expand Down
4 changes: 2 additions & 2 deletions src/components/HeaderLink.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import type { HTMLAttributes } from 'astro/types';
import type { HTMLAttributes } from "astro/types";
type Props = HTMLAttributes<'a'>;
type Props = HTMLAttributes<"a">;
const { href, class: className, ...props } = Astro.props;
Expand Down
4 changes: 2 additions & 2 deletions src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Place any global data in this file.
// You can import this data from anywhere in your site by using the `import` keyword.

export const SITE_TITLE = 'MCC';
export const SITE_DESCRIPTION = 'Welcome to my website!';
export const SITE_TITLE = "MCC";
export const SITE_DESCRIPTION = "Welcome to my website!";
12 changes: 6 additions & 6 deletions src/layouts/BlogPost.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
import type { CollectionEntry } from 'astro:content';
import BaseHead from '../components/BaseHead.astro';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import FormattedDate from '../components/FormattedDate.astro';
import type { CollectionEntry } from "astro:content";
import BaseHead from "../components/BaseHead.astro";
import Footer from "../components/Footer.astro";
import FormattedDate from "../components/FormattedDate.astro";
import Header from "../components/Header.astro";
type Props = CollectionEntry<'blog'>['data'];
type Props = CollectionEntry<"blog">["data"];
const { title, description, date, lastmod, image } = Astro.props;
---
Expand Down
24 changes: 12 additions & 12 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import "../styles/global.css";
import BaseHead from "../components/BaseHead.astro";
export interface Props {
title: string;
description?: string;
path: string;
pagefind: boolean;
og: {
enabled: boolean;
image?: URL;
width?: number;
height?: number;
type?: "article" | "website";
}
};
title: string;
description?: string;
path: string;
pagefind: boolean;
og: {
enabled: boolean;
image?: URL;
width?: number;
height?: number;
type?: "article" | "website";
};
}
// const site = Astro.site ?? "";
---
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Layout from '../layouts/Layout.astro';
import Layout from "../layouts/Layout.astro";
---

<Layout
Expand Down
8 changes: 4 additions & 4 deletions src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
import { type CollectionEntry, getCollection } from 'astro:content';
import BlogPost from '../../layouts/BlogPost.astro';
import { type CollectionEntry, getCollection } from "astro:content";
import BlogPost from "../../layouts/BlogPost.astro";
export async function getStaticPaths() {
const posts = await getCollection('blog');
const posts = await getCollection("blog");
return posts.map((post) => ({
params: { slug: post.slug },
props: post,
}));
}
type Props = CollectionEntry<'blog'>;
type Props = CollectionEntry<"blog">;
const post = Astro.props;
const { Content } = await post.render();
Expand Down
16 changes: 8 additions & 8 deletions src/pages/blog/index.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
import BaseHead from '../../components/BaseHead.astro';
import Header from '../../components/Header.astro';
import Footer from '../../components/Footer.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
import { getCollection } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
import { getCollection } from "astro:content";
import BaseHead from "../../components/BaseHead.astro";
import Footer from "../../components/Footer.astro";
import FormattedDate from "../../components/FormattedDate.astro";
import Header from "../../components/Header.astro";
import { SITE_DESCRIPTION, SITE_TITLE } from "../../consts";
const posts = (await getCollection('blog')).sort(
(a, b) => a.data.date.valueOf() - b.data.date.valueOf()
const posts = (await getCollection("blog")).sort(
(a, b) => a.data.date.valueOf() - b.data.date.valueOf(),
);
---

Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Navigation from "../components/Navigation/Navigation"
import Layout from "../layouts/Layout.astro"
import Navigation from "../components/Navigation/Navigation";
import Layout from "../layouts/Layout.astro";
---

<Layout title="MCC" path="" og={{enabled: true}} pagefind={false}>
Expand Down
18 changes: 9 additions & 9 deletions tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {},
fontFamily: {
sans: ["Hiragino Kaku Gothic ProN", "sans-serif"],
orbitron: ["Orbitron", "sans-serif"],
},
},
plugins: [],
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {},
fontFamily: {
sans: ["Hiragino Kaku Gothic ProN", "sans-serif"],
orbitron: ["Orbitron", "sans-serif"],
},
},
plugins: [],
};
14 changes: 7 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"strictNullChecks": true,
"paths": {
"@/": ["./src/"]
}
}
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"strictNullChecks": true,
"paths": {
"@/": ["./src/"]
}
}
}

0 comments on commit ad5d884

Please sign in to comment.