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",