Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env node
// PostToolUse(Edit|Write) hook: 編集されたファイルを Biome で整形+import 整理する(非ブロッキング)。
// PostToolUse(Edit|Write) hook: 編集されたファイルに oxlint --fix(stylistic 含む)を適用する(非ブロッキング)。
import { execFileSync } from 'node:child_process';

const projectDir = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();

const file = await readFilePath();
if (!file || !/\.(tsx?|jsx?|mjs|cjs|jsonc?)$/.test(file)) {
if (!file || !/\.(tsx?|jsx?|mjs|cjs)$/.test(file)) {
process.exit(0);
}

try {
execFileSync('pnpm', ['exec', 'biome', 'check', '--write', file], {
execFileSync('pnpm', ['exec', 'oxlint', '--fix', file], {
cwd: projectDir,
stdio: 'ignore',
});
Expand Down
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"hooks": [
{
"type": "command",
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/biome-format.mjs\""
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/oxlint-fix.mjs\""
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/preflight/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ allowed-tools: Bash, Read
「どこが緑/赤か」を一覧にする。すべて緑なら「PR 可」と明言する。

1. `pnpm run typecheck` — core を build してから各 package を `tsc --noEmit`。
2. `pnpm run lint` — `biome check .`。
2. `pnpm run lint` — `oxlint`(type-aware + stylistic)。
3. `pnpm run test:unit` — 純粋ロジック。
4. `pnpm run test:integration` — 実モデルロード+実 classify。
**モデル不在なら自動 skip** される(その場合は「skip」と明示し、緑とは区別する)。
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ curl -X POST localhost:3000/v1/detect-images \
pnpm install
pnpm run build # tsdown(高速 JS 出力。依存は external)
pnpm run typecheck # core を build してから各 package を型チェック
pnpm run lint # biome
pnpm run lint # oxlint(stylistic 含む)。自動修正は pnpm run lint:fix
pnpm run test:unit # 純粋ロジック
pnpm run test:integration # 実モデルロード+実 classify(モデルが無ければ skip)

Expand Down
32 changes: 0 additions & 32 deletions biome.jsonc

This file was deleted.

28 changes: 28 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
defineMisskeyDevOxlintConfig,
oxlintJsRules,
oxlintStylisticRules,
} from '@misskey-dev/oxlint-fmt-config';

export default defineMisskeyDevOxlintConfig({
overrides: {
ignorePatterns: ['**/dist/**', 'nsfw-model/**'],
overrides: [
{
// 共通設定の JS 向けルールは *.js / *.jsx のみが対象のため、ESM / CJS スクリプトにも適用する。
files: ['**/*.mjs', '**/*.cjs'],
rules: {
...oxlintJsRules,
...oxlintStylisticRules,
},
},
{
// 設定ファイルはツール側の規約で default export が必須。
files: ['**/*.config.ts', 'config.*.mjs'],
rules: {
'import/no-default-export': 'off',
},
},
],
},
});
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
"test": "vitest run",
"test:unit": "vitest run --project unit",
"test:integration": "vitest run --project integration",
"lint": "pnpm exec -- biome check .",
"format": "pnpm exec -- biome format --write ."
"lint": "oxlint",
"lint:fix": "oxlint --fix"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@misskey-dev/oxlint-fmt-config": "catalog:",
"@stylistic/eslint-plugin": "catalog:",
"@types/node": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"tsdown": "catalog:",
"tsx": "catalog:",
"typescript": "catalog:",
Expand Down
Loading
Loading