chore: add coding conventions from nerve

- CLAUDE.md: functional-first, type over interface, no optional props, Result type
- biome.json: lint + format config (Biome 1.9)
- tsconfig.json: strict mode, composite project references
- .cursor/rules: global conventions + no-dynamic-import

Adapted from uncaged/nerve for bun workspace.

小橘 <xiaoju@shazhou.work>
This commit is contained in:
2026-05-06 04:26:03 +00:00
parent 8939194133
commit eeb5fa0d75
5 changed files with 300 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"files": {
"ignore": ["**/dist/**", "**/node_modules/**"]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always"
}
},
"overrides": [
{
"include": ["**/__tests__/**"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
},
"style": {
"noNonNullAssertion": "off"
}
}
}
}
],
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noDefaultExport": "error",
"useNodejsImportProtocol": "error",
"noNamespace": "error",
"noParameterProperties": "error",
"useImportType": "error",
"useShorthandFunctionType": "error",
"noVar": "error",
"useConst": "error",
"useEnumInitializers": "error"
},
"complexity": {
"noThisInStatic": "error",
"noStaticOnlyClass": "error",
"noForEach": "error",
"useArrowFunction": "error",
"noExcessiveCognitiveComplexity": {
"level": "warn",
"options": {
"maxAllowedComplexity": 15
}
}
},
"suspicious": {
"noExplicitAny": "error"
},
"correctness": {
"noUnusedVariables": "error",
"noUnusedImports": "error"
}
}
}
}