Skip to content

Commit

Permalink
Make Biome match Prettier behaviour when formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus21337 committed Jul 25, 2024
1 parent fd8fcc7 commit dfaf4f1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
version: latest

- run: biome ci --linter-enabled=false
- run: biome ci --no-errors-on-unmatched --changed --since=main --linter-enabled=false

build:
needs: check
Expand Down
10 changes: 7 additions & 3 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"*.{ts,astro}": [
"biome format --write --no-errors-on-unmatched",
"biome format --write --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none",
"biome lint --write --unsafe --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none",
"eslint",
"tsc-files"
],
"*.{js,mjs,cjs}": [
"biome format --write --no-errors-on-unmatched",
"biome format --write --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none",
"biome lint --write --unsafe --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none",
"eslint"
],
"*.{json,md}": ["biome format --write --no-errors-on-unmatched"]
"*.{json,md}": [
"biome format --write --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"format": "biome format --write --no-errors-on-unmatched",
"format": "biome format --write --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none && biome lint --write --unsafe --skip-errors --no-errors-on-unmatched --changed --since=main --log-level=none",
"lint": "eslint .",
"lint:formatting": "biome check --changed --since=main --linter-enabled=false",
"prepare": "husky"
Expand Down
5 changes: 2 additions & 3 deletions src/content/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { z as zod } from "astro:content";
import type { z as zod } from "astro:content";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { blogsSchema } from "@/content/config";
import type { blogsSchema } from "@/content/config";

export type BlogsFrontmatter = zod.infer<typeof blogsSchema>;

Expand Down
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
declare module '*.astro'

0 comments on commit dfaf4f1

Please sign in to comment.