新增根 biome.json(v2.5,v2 起原生支持 monorepo,子包自动向上查找):
- formatter: 2 空格缩进、单引号、行宽 100、LF、尾逗号、箭头函数括号
(匹配现有代码风格)
- linter: recommended preset + 项目化裁剪
- useTemplate/useTemplate off(geometry.ts 故意保留字符串拼接,
且测试用精确浮点断言锁定行为)
- noNonNullAssertion off(测试与 DOM 访问里的 ! 是惯用写法)
- noConsole off(4 个 lib 用 console.error/warn 做错误上报)
- CSS 关闭 noDescendingSpecificity/noDuplicateProperties
(手写 CSS 的 fallback 模式)
- useImportType/useNodejsImportProtocol/noUnusedVariables warn
- vcs.useIgnoreFile 自动读 .gitignore;排除 public/target/node_modules/
dist/.dioxus/static + Tailwind 入口 input.css(含 @theme 等 Biome 无法
解析的 at-rules)
首次格式化覆盖 29 个源文件:import 排序、node: 协议、引号/缩进统一,
并修复 index.ts 两处 forEach 回调隐式返回值(useIterableCallbackReturn)。
90 个 vitest 用例全绿,确认无语义改动。
87 lines
1.6 KiB
JSON
87 lines
1.6 KiB
JSON
{
|
|
"$schema": "https://biomejs.dev/schemas/2.5.1/schema.json",
|
|
"vcs": {
|
|
"enabled": true,
|
|
"clientKind": "git",
|
|
"useIgnoreFile": true
|
|
},
|
|
"files": {
|
|
"includes": [
|
|
"**/*.ts",
|
|
"**/*.js",
|
|
"**/*.json",
|
|
"**/*.jsonc",
|
|
"**/*.css",
|
|
"**/*.html",
|
|
"!**/node_modules",
|
|
"!**/dist",
|
|
"!**/target",
|
|
"!public",
|
|
"!.dioxus",
|
|
"!static",
|
|
"!input.css"
|
|
]
|
|
},
|
|
"formatter": {
|
|
"enabled": true,
|
|
"indentStyle": "space",
|
|
"indentWidth": 2,
|
|
"lineWidth": 100,
|
|
"lineEnding": "lf"
|
|
},
|
|
"linter": {
|
|
"enabled": true,
|
|
"rules": {
|
|
"preset": "recommended",
|
|
"style": {
|
|
"useImportType": "warn",
|
|
"useNodejsImportProtocol": "warn",
|
|
"useTemplate": "off",
|
|
"noNonNullAssertion": "off"
|
|
},
|
|
"suspicious": {
|
|
"noConsole": "off",
|
|
"noExplicitAny": "off"
|
|
},
|
|
"correctness": {
|
|
"noUnusedVariables": "warn"
|
|
}
|
|
}
|
|
},
|
|
"javascript": {
|
|
"formatter": {
|
|
"quoteStyle": "single",
|
|
"semicolons": "always",
|
|
"trailingCommas": "all",
|
|
"arrowParentheses": "always"
|
|
}
|
|
},
|
|
"json": {
|
|
"formatter": {
|
|
"enabled": true,
|
|
"indentWidth": 2
|
|
}
|
|
},
|
|
"css": {
|
|
"formatter": {
|
|
"enabled": true,
|
|
"quoteStyle": "single"
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
"includes": ["**/*.css"],
|
|
"linter": {
|
|
"rules": {
|
|
"style": {
|
|
"noDescendingSpecificity": "off"
|
|
},
|
|
"suspicious": {
|
|
"noDuplicateProperties": "off"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|