Skip to content

Commit

Permalink
ESLint + Prettier から Biome に移行する (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
mashabow authored Sep 24, 2024
2 parents 5067124 + 618347d commit 4b67a2f
Show file tree
Hide file tree
Showing 14 changed files with 479 additions and 1,204 deletions.
18 changes: 9 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "mashabow/mswpida" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "mashabow/mswpida" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/proud-pugs-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"mswpida": patch
---

Migrate ESLint and Prettier to Biome
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc.cjs

This file was deleted.

19 changes: 3 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: CI
on: push

jobs:
eslint:
name: ESLint
biome:
name: Lint and Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -14,20 +14,7 @@ jobs:
node-version-file: '.node-version'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:eslint

prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:prettier
- run: pnpm lint:biome

tsc:
name: Type Check
Expand Down
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.js

This file was deleted.

60 changes: 60 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": ["test/generated-api/"]
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"all": true,
"correctness": {
"useImportExtensions": {
"level": "off"
}
},
"style": {
"useNamingConvention": {
"level": "warn",
"options": {
"strictCase": false,
"conventions": [
{
"selector": {
"kind": "typeParameter"
},
"match": "[A-Z]|T\\$?[A-Z][A-Za-z0-9]+"
}
]
}
}
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"overrides": [
{
// pnpm add/remove したときに崩れないように、pnpm と同じフォーマットにする
"include": ["package.json"],
"formatter": {
"lineWidth": 1
}
}
]
}
126 changes: 57 additions & 69 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,59 @@
{
"name": "mswpida",
"version": "2.0.0",
"description": "A wrapper to use MSW in a type-safe manner for aspida users.",
"keywords": [
"msw",
"aspida",
"typescript"
],
"repository": {
"type": "git",
"url": "https://github.com/mashabow/mswpida.git"
},
"license": "MIT",
"author": "Masaya Nakamura <[email protected]>",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"main": "dist/index.js",
"files": [
"dist",
"src"
],
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts",
"generate:example-api": "openapi2aspida -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/3.1.0/examples/v3.0/petstore-expanded.yaml -o ./example/generated-api",
"lint:eslint": "eslint .",
"lint:prettier": "prettier --check .",
"lint:tsc": "tsc --noEmit",
"test": "vitest",
"release": "pnpm build && changeset publish"
},
"devDependencies": {
"@aspida/fetch": "^1.14.0",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@tsconfig/node20": "^20.1.2",
"@tsconfig/strictest": "^2.0.2",
"@types/node": "^20.16.2",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"aspida": "^1.14.0",
"eslint": "^8.51.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"msw": "^2.4.1",
"openapi2aspida": "^0.23.2",
"prettier": "^3.0.3",
"tsup": "7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
},
"peerDependencies": {
"aspida": "^1.14.0",
"msw": "^2.4.1"
},
"packageManager": "[email protected]",
"pnpm": {
"overrides": {
"tsconfig-paths": "^4.0.0"
}
},
"readme": "https://github.com/mashabow/mswpida#readme"
"name": "mswpida",
"version": "2.0.0",
"description": "A wrapper to use MSW in a type-safe manner for aspida users.",
"keywords": [
"msw",
"aspida",
"typescript"
],
"repository": {
"type": "git",
"url": "https://github.com/mashabow/mswpida.git"
},
"license": "MIT",
"author": "Masaya Nakamura <[email protected]>",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"main": "dist/index.js",
"files": [
"dist",
"src"
],
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts",
"generate:example-api": "openapi2aspida -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/3.1.0/examples/v3.0/petstore-expanded.yaml -o ./example/generated-api",
"lint:biome": "biome check .",
"lint:biome:ci": "biome ci .",
"lint:tsc": "tsc --noEmit",
"test": "vitest",
"release": "pnpm build && changeset publish"
},
"devDependencies": {
"@aspida/fetch": "^1.14.0",
"@biomejs/biome": "1.9.2",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@tsconfig/node20": "^20.1.2",
"@tsconfig/strictest": "^2.0.2",
"@types/node": "^20.16.2",
"aspida": "^1.14.0",
"msw": "^2.4.1",
"openapi2aspida": "^0.23.2",
"tsup": "7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
},
"peerDependencies": {
"aspida": "^1.14.0",
"msw": "^2.4.1"
},
"packageManager": "[email protected]",
"readme": "https://github.com/mashabow/mswpida#readme"
}
Loading

0 comments on commit 4b67a2f

Please sign in to comment.