Skip to content

Commit

Permalink
Biome
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Apr 22, 2024
1 parent e5bae85 commit 0b01edc
Show file tree
Hide file tree
Showing 6 changed files with 2,922 additions and 2,290 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
name: CI

on: [push, pull_request]

jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [16, 18, 20, 21]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
- run: corepack enable

- name: Use Node ${{ matrix.node }}
- name: Set-up Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
Expand All @@ -26,11 +34,14 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: CI checks with Biome
run: pnpm run ci

- name: Typecheck
run: pnpm typecheck
run: pnpm run typecheck

- name: Test
run: pnpm test -- --coverage
run: pnpm run test -- --coverage

- name: Build
run: pnpm build
run: pnpm run build
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc.toml

This file was deleted.

24 changes: 24 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["pnpm-lock.yaml"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"prebuild": "pnpm clean",
"build": "tsup",
"ci": "biome ci .",
"clean": "rimraf dist",
"format": "sort-package-json && prettier --write .",
"format": "sort-package-json && biome format --write .",
"lint": "biome lint .",
"prepack": "pnpm build",
"release": "np",
"start": "pnpm build -- --watch",
Expand All @@ -46,11 +46,11 @@
"npm-run-path": "^5.3.0"
},
"devDependencies": {
"@biomejs/biome": "^1.7.0",
"@sindresorhus/tsconfig": "^5.0.0",
"@types/node": "^20.12.7",
"@vitest/coverage-v8": "^1.5.0",
"np": "*",
"prettier": "3.2.5",
"rimraf": "^5.0.5",
"sort-package-json": "^2.10.0",
"tsup": "^8.0.2",
Expand All @@ -62,7 +62,7 @@
"rescript": ">=9",
"vite": ">=5.1.0"
},
"packageManager": "pnpm@8.11.0",
"packageManager": "pnpm@9.0.5+sha512.a722575c18fd791f9ef71e387c6e16cc03c90d859b9b0998d0428ca0e3220828b32a96e6de73cea34edbc0f50824771b1a69c7ea36b86daa3b89c7e6d9a3d912",
"engines": {
"node": ">=16.0"
}
Expand Down
Loading

0 comments on commit 0b01edc

Please sign in to comment.