Skip to content

Commit

Permalink
fix biome organise imports issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Jul 25, 2024
1 parent 91d4711 commit a280eaa
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 35 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,14 @@ on:
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- run: npm run format:check

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- run: npm run lint:check
- run: npm run lint:ci

build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,7 +83,6 @@ jobs:
runs-on: ubuntu-latest
concurrency: deploy-group
needs:
- format
- lint
- test
- e2e
Expand Down
5 changes: 1 addition & 4 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ pre-push:
test:
run: npm run test --workspace=@digital-garden/blog
pre-commit:
parallel: true
commands:
lint:
run: npm run lint:check
format:
run: npm run format:check
run: npm run lint:ci
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"workspaces": ["packages/*"],
"scripts": {
"prepare": "lefthook install",
"format:check": "biome format .",
"format:fix": "biome format --write .",
"lint:check": "biome lint .",
"lint:fix": "biome lint --write .",
"lint:fix:unsafe": "biome lint --write --unsafe ."
"lint:check": "biome check .",
"lint:write": "biome check --write .",
"lint:write:unsafe": "biome check --write --unsafe .",
"lint:ci": "biome ci ."
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/config/globals/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import process from "node:process";
import { z } from "zod";

const envSchema = z.object({
// biome-ignore lint/style/useNamingConvention: env variables have different convention
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/posts/components/pinned-posts.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { format } from "date-fns";
import type { FC } from "react";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";
import { ArchiveListItem } from "../../ui/components/archive-list-item.js";
import { StandOut } from "../../ui/components/stand-out.js";
import { cn } from "../../ui/utils/cn.js";
import type { PostModel } from "../models/post.model.js";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";

export const PinnedPosts: FC<PinnedPostsProps> = ({ posts }) => (
<menu>
Expand Down
4 changes: 2 additions & 2 deletions packages/blog/src/posts/components/post-tiled-list-item.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { format } from "date-fns";
import type { FC } from "react";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";
import { Caption } from "../../ui/components/caption.js";
import { Link } from "../../ui/components/link.js";
import { ThemedImage } from "../../ui/components/themed-image.js";
import { Title } from "../../ui/components/title.js";
import { cn } from "../../ui/utils/cn.js";
import { isPostWithCover, type PostModel } from "../models/post.model.js";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";
import { type PostModel, isPostWithCover } from "../models/post.model.js";

export const PostTiledListItem: FC<PostTiledListItemProps> = ({ post }) => (
<li
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/posts/components/related-posts.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { format } from "date-fns";
import type { FC } from "react";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";
import { ArchiveListItem } from "../../ui/components/archive-list-item.js";
import { ArchiveList } from "../../ui/components/archive-list.js";
import { StandOut } from "../../ui/components/stand-out.js";
import { Title } from "../../ui/components/title.js";
import { cn } from "../../ui/utils/cn.js";
import type { PostModel } from "../models/post.model.js";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";

export const RelatedPosts: FC<RelatedPostsProps> = ({ posts }) => (
<StandOut className="flex-col">
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/posts/models/post.datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
readContentFile,
} from "../../content/utils/fs.js";
import { processor } from "../../content/utils/processor.js";
import { isPostWithCover, postSchema, type PostModel } from "./post.model.js";
import { type PostModel, isPostWithCover, postSchema } from "./post.model.js";

export async function findPosts(
ids: Array<string> = [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { format } from "date-fns";
import type { FC } from "react";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";
import { ArchiveListItem } from "../../ui/components/archive-list-item.js";
import { ArchiveList } from "../../ui/components/archive-list.js";
import type { ChangelogModel } from "../models/changelog.model.js";
import { publishedAtFormat } from "../../content/globals/published-at-format.js";

export const ProjectChangelogs: FC<ProjectChangelogsProps> = ({
changelogs,
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/projects/components/version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { ComponentPropsWithoutRef, FC, PropsWithChildren } from "react";
import { Badge } from "../../ui/components/badge.js";
import type { TailwindColor } from "../../ui/types/tailwind-color.js";
import {
projectStatusToLabel,
type ProjectStatus,
projectStatusToLabel,
} from "../models/project.model.js";

export const Version: FC<PropsWithChildren<VersionProps>> = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/projects/models/changelog.datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { compareDesc } from "date-fns";
import type { VFile } from "vfile";
import { readContentDir, readContentFile } from "../../content/utils/fs.js";
import { processor } from "../../content/utils/processor.js";
import { changelogSchema, type ChangelogModel } from "./changelog.model.js";
import { type ChangelogModel, changelogSchema } from "./changelog.model.js";

export async function findChangelogs(
projectId = "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/projects/models/project.datasource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { VFile } from "vfile";
import { readContentDir, readContentFile } from "../../content/utils/fs.js";
import { processor } from "../../content/utils/processor.js";
import { projectSchema, type ProjectModel } from "./project.model.js";
import { type ProjectModel, projectSchema } from "./project.model.js";

export async function findProjects(): Promise<Array<ProjectModel>> {
const projectFilePaths = await readContentDir("projects");
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/ui/layouts/default.layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { URL } from "node:url";
import type { FC, PropsWithChildren } from "react";
import { profile } from "../../config/globals/profile.js";
import type { Env } from "../../config/globals/env.js";
import { profile } from "../../config/globals/profile.js";
import { Background } from "../components/background.js";
import { ButtonLink } from "../components/button-link.js";
import { Button } from "../components/button.js";
Expand Down
4 changes: 2 additions & 2 deletions packages/blog/src/ui/ui.module.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fastifyStatic from "@fastify/static";
import type { FastifyPluginAsync } from "fastify";
import path from "node:path";
import process from "node:process";
import fastifyStatic from "@fastify/static";
import type { FastifyPluginAsync } from "fastify";

export const uiModule: FastifyPluginAsync = async (app) => {
await app.register(fastifyStatic, {
Expand Down
2 changes: 1 addition & 1 deletion packages/blog/src/ui/utils/cn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clsx, type ClassValue } from "clsx";
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Array<ClassValue>): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas/src/home/pages/home.page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC } from "react";
import { Link } from "react-router-dom";
import { rootRoute, type RootRoute } from "../../ui/types/root-route.ts";
import { type RootRoute, rootRoute } from "../../ui/types/root-route.ts";

export const HomePage: FC = () => (
<nav>
Expand Down

0 comments on commit a280eaa

Please sign in to comment.