From 074ea844dc71b66ea6d1d132c2dc06f4547b2bd2 Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Wed, 1 Apr 2026 01:40:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AE=20Biome=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=B8=8E=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 biome.json 配置(formatter + linter + organizeImports), .editorconfig 统一编辑器配置,package.json 新增 lint/format scripts。 Co-Authored-By: Claude Opus 4.6 --- .editorconfig | 16 +++++++++++ TODO.md | 8 +++++- biome.json | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 +++- 4 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 .editorconfig create mode 100644 biome.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b34154e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[*.{json,yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/TODO.md b/TODO.md index 09ba82c..65f1621 100644 --- a/TODO.md +++ b/TODO.md @@ -13,4 +13,10 @@ \ No newline at end of file +- [ ] `@ant/claude-for-chrome-mcp` — Chrome MCP 扩展 --> + +## 工程化能力 + +- [x] 代码格式化与校验 +- [ ] 冗余代码检查 +- [ ] git hook 的配置 diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..cc6c405 --- /dev/null +++ b/biome.json @@ -0,0 +1,79 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.4.10/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "includes": ["**", "!!**/dist", "!!**/packages/@ant"] + }, + "formatter": { + "enabled": true, + "indentStyle": "tab", + "lineWidth": 120 + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noExplicitAny": "off", + "noAssignInExpressions": "off", + "noDoubleEquals": "off", + "noRedeclare": "off", + "noImplicitAnyLet": "off", + "noGlobalIsNan": "off", + "noFallthroughSwitchClause": "off", + "noShadowRestrictedNames": "off" + }, + "style": { + "useConst": "off", + "noNonNullAssertion": "off", + "noParameterAssign": "off", + "useDefaultParameterLast": "off", + "noUnusedTemplateLiteral": "off", + "useTemplate": "off", + "useNumberNamespace": "off" + }, + "complexity": { + "noForEach": "off", + "noBannedTypes": "off", + "noUselessConstructor": "off", + "noStaticOnlyClass": "off", + "useOptionalChain": "off", + "noUselessSwitchCase": "off", + "noUselessFragments": "off", + "noUselessTernary": "off", + "noUselessLoneBlockStatements": "off" + }, + "correctness": { + "noUnusedVariables": "off", + "noUnusedImports": "off", + "useExhaustiveDependencies": "off", + "noSwitchDeclarations": "off", + "noUnreachable": "off", + "useHookAtTopLevel": "off" + }, + "a11y": { + "recommended": false + }, + "nursery": { + "recommended": false + } + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + } +} diff --git a/package.json b/package.json index cf4e4fb..642ecfa 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,10 @@ "scripts": { "build": "bun build src/entrypoints/cli.tsx --outdir dist --target bun", "dev": "bun run src/entrypoints/cli.tsx", - "prepublishOnly": "bun run build" + "prepublishOnly": "bun run build", + "lint": "biome check src/", + "lint:fix": "biome check --fix src/", + "format": "biome format --write src/" }, "dependencies": { "@alcalzone/ansi-tokenize": "^0.3.0",