Skip to content

Commit

Permalink
Merge pull request #26 from tatsutakein-jp/feature/GH-25
Browse files Browse the repository at this point in the history
feat: Biome を導入
  • Loading branch information
tatsutakein authored Jul 3, 2024
2 parents fbad2cc + 449ecfb commit 2d074d4
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 69 deletions.
53 changes: 53 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
},
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "single",
"quoteProperties": "asNeeded",
"trailingCommas": "none",
"semicolons": "asNeeded",
"arrowParentheses": "asNeeded",
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"bracketSameLine": true,
"bracketSpacing": true,
"attributePosition": "auto"
}
},
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"trailingCommas": "none"
}
}
}
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"preview": "astro preview",
"astro": "astro",
"clean": "git clean -xdf node_modules",
"lint": "biome lint ./src",
"lint:fix": "biome lint --write ./src",
"format": "biome check --write ./src",
"plop": "plop"
},
"dependencies": {
Expand All @@ -23,6 +26,7 @@
},
"devDependencies": {
"@astrojs/check": "0.7.0",
"@biomejs/biome": "1.8.3",
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"lefthook": "1.6.18",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
const currentYear = new Date().getFullYear();
const currentYear = new Date().getFullYear()
---

<footer>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Hero.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
interface Props {
title: string;
tagline?: string;
align?: 'start' | 'center';
title: string
tagline?: string
align?: 'start' | 'center'
}
const { align = 'center', tagline, title } = Astro.props;
const { align = 'center', tagline, title } = Astro.props
---

<div class:list={['hero stack gap-4', align]}>
Expand Down
22 changes: 11 additions & 11 deletions src/components/Icon.astro
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
import type { HTMLAttributes } from 'astro/types';
import { iconPaths } from './IconPaths';
import type { HTMLAttributes } from 'astro/types'
import { iconPaths } from './IconPaths'
interface Props {
icon: keyof typeof iconPaths;
color?: string;
gradient?: boolean;
size?: string;
icon: keyof typeof iconPaths
color?: string
gradient?: boolean
size?: string
}
const { color = 'currentcolor', gradient, icon, size } = Astro.props;
const iconPath = iconPaths[icon];
const { color = 'currentcolor', gradient, icon, size } = Astro.props
const iconPath = iconPaths[icon]
const attrs: HTMLAttributes<'svg'> = {};
if (size) attrs.style = { '--size': size };
const attrs: HTMLAttributes<'svg'> = {}
if (size) attrs.style = { '--size': size }
const gradientId = 'icon-gradient-' + Math.round(Math.random() * 10e12).toString(36);
const gradientId = `icon-gradient-${Math.round(Math.random() * 10e12).toString(36)}`
---

<svg
Expand Down
50 changes: 25 additions & 25 deletions src/components/IconPaths.ts

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions src/components/MainHead.astro
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
import '../styles/global.css';
import '../styles/global.css'
interface Props {
title?: string | undefined;
description?: string | undefined;
title?: string | undefined
description?: string | undefined
}
const {
title = 'ASIS',
description = 'The quest to live life as it is',
} = Astro.props;
const { title = 'ASIS', description = 'The quest to live life as it is' } = Astro.props
---

<meta charset="UTF-8"/>
Expand Down
26 changes: 17 additions & 9 deletions src/components/Nav.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
---
import Icon from './Icon.astro';
import ThemeToggle from './ThemeToggle.astro';
import type { iconPaths } from './IconPaths';
import Icon from './Icon.astro'
import type { iconPaths } from './IconPaths'
import ThemeToggle from './ThemeToggle.astro'
/** Main menu items */
const textLinks: { label: string; href: string }[] = [
{ label: 'Home', href: '/' },
// { label: 'About', href: '/about/' },
];
{ label: 'Home', href: '/' }
// { label: 'About', href: '/about/' },
]
/** Icon links to social media — edit these with links to your profiles! */
const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[] = [
{ label: 'GitHub', href: 'https://github.com/tatsutakein-jp/asis.quest', icon: 'github-logo' },
];
const iconLinks: {
label: string
href: string
icon: keyof typeof iconPaths
}[] = [
{
label: 'GitHub',
href: 'https://github.com/tatsutakein-jp/asis.quest',
icon: 'github-logo'
}
]
---

<nav>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ThemeToggle.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Icon from './Icon.astro';
import Icon from './Icon.astro'
---

<theme-toggle>
Expand Down
2 changes: 1 addition & 1 deletion src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference types="astro/client" />
/// <reference types="astro/client" />
12 changes: 6 additions & 6 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// Learn about using Astro layouts:
// https://docs.astro.build/en/core-concepts/layouts/
import Footer from '../components/Footer.astro'
// Component Imports
import MainHead from '../components/MainHead.astro';
import Nav from '../components/Nav.astro';
import Footer from '../components/Footer.astro';
import MainHead from '../components/MainHead.astro'
import Nav from '../components/Nav.astro'
interface Props {
title?: string | undefined;
description?: string | undefined;
title?: string | undefined
description?: string | undefined
}
const { title, description } = Astro.props;
const { title, description } = Astro.props
---

<html lang="en">
Expand Down
4 changes: 2 additions & 2 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Hero from '../components/Hero.astro';
import BaseLayout from '../layouts/BaseLayout.astro';
import Hero from '../components/Hero.astro'
import BaseLayout from '../layouts/BaseLayout.astro'
---

<BaseLayout title="Not Found" description="404 Error — this page was not found">
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
// Layout import — provides basic page elements: <head>, <nav>, <footer> etc.
import BaseLayout from '../layouts/BaseLayout.astro';
import BaseLayout from '../layouts/BaseLayout.astro'
// Component Imports
import Hero from '../components/Hero.astro';
import Hero from '../components/Hero.astro'
// Full Astro Component Syntax:
// https://docs.astro.build/core-concepts/astro-components/
Expand Down

0 comments on commit 2d074d4

Please sign in to comment.