Loading...
Loading...
Compare original and translation side by side
files.includes{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["@sablier/devkit/biome"],
"files": {
"includes": ["**/*.{js,json,jsonc,ts}", "!node_modules/**/*"]
}
}{
"extends": ["@sablier/devkit/biome/base", "@sablier/devkit/biome/ui"],
"files": {
"includes": ["**/*.{css,js,jsx,json,jsonc,ts,tsx}"]
}
}files.includes{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["@sablier/devkit/biome"],
"files": {
"includes": ["**/*.{js,json,jsonc,ts}", "!node_modules/**/*"]
}
}{
"extends": ["@sablier/devkit/biome/base", "@sablier/devkit/biome/ui"],
"files": {
"includes": ["**/*.{css,js,jsx,json,jsonc,ts,tsx}"]
}
}"//"// packages/my-package/biome.jsonc
{
"extends": ["//"],
"overrides": [
// package-specific overrides
]
}"//"// packages/my-package/biome.jsonc
{
"extends": ["//"],
"overrides": [
// 包专属的覆盖规则
]
}files.includes| Project Type | Pattern |
|---|---|
| Library | |
| UI/Frontend | |
| With GraphQL | |
!node_modules/**/*!**/generated!distfiles.includes| 项目类型 | 匹配模式 |
|---|---|
| 类库 | |
| UI/前端 | |
| 包含GraphQL | |
!node_modules/**/*!**/generated!dist{
"overrides": [
{
"includes": ["**/tests/**/*.ts", "**/*.test.ts"],
"linter": {
"rules": {
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}{
"overrides": [
{
"includes": ["**/tests/**/*.ts", "**/*.test.ts"],
"linter": {
"rules": {
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}{
"overrides": [
{
"includes": ["**/abi/**/*.ts", "**/generated/**/*.ts"],
"assist": {
"actions": {
"source": {
"useSortedKeys": "off"
}
}
},
"javascript": {
"formatter": {
"expand": "never"
}
}
}
]
}{
"overrides": [
{
"includes": ["**/abi/**/*.ts", "**/generated/**/*.ts"],
"assist": {
"actions": {
"source": {
"useSortedKeys": "off"
}
}
},
"javascript": {
"formatter": {
"expand": "never"
}
}
}
]
}{
"overrides": [
{
"includes": ["src/**/*.{ts,tsx}"],
"linter": {
"rules": {
"correctness": {
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"@/core": "Import from @/core (barrel) instead of subpaths"
}
}
}
}
}
}
}
]
}{
"overrides": [
{
"includes": ["src/**/*.{ts,tsx}"],
"linter": {
"rules": {
"correctness": {
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"@/core": "Import from @/core (barrel) instead of subpaths"
}
}
}
}
}
}
}
]
}| Rule | Default | Rationale |
|---|---|---|
| error | Floating promises cause bugs |
| off | Allow during dev, enforce in pre-commit |
| error | Keep code clean |
| warn (separatedType) | Explicit type imports |
| on | Consistent object ordering |
| warn (UI) | Tailwind class sorting |
| kebab/camel/Pascal | Flexible naming |
| off | Useful for useEffect callbacks |
| off | Allow string concatenation |
| 规则 | 默认设置 | 理由 |
|---|---|---|
| error | 未处理的Promise会导致bug |
| off | 开发期间允许,预提交时强制执行 |
| error | 保持代码简洁 |
| warn (separatedType) | 显式类型导入 |
| on | 统一对象键顺序 |
| warn (UI) | Tailwind类排序 |
| kebab/camel/Pascal | 灵活的命名规则 |
| off | 在useEffect回调中很实用 |
| off | 允许字符串拼接 |
// .lintstagedrc.js
module.exports = {
"*.{json,jsonc,ts,tsx}": "bun biome check --write",
"*.{md,yml,yaml}": "bun prettier --cache --write",
"*.{ts,tsx}": "bun biome lint --write --only correctness/noUnusedImports",
};noUnusedImports// .lintstagedrc.js
module.exports = {
"*.{json,jsonc,ts,tsx}": "bun biome check --write",
"*.{md,yml,yaml}": "bun prettier --cache --write",
"*.{ts,tsx}": "bun biome lint --write --only correctness/noUnusedImports",
};noUnusedImports{
"css": {
"parser": {
"cssModules": true,
"tailwindDirectives": true
}
},
"assist": {
"actions": {
"source": {
"useSortedAttributes": "on"
}
}
},
"linter": {
"rules": {
"nursery": {
"useSortedClasses": {
"fix": "safe",
"level": "warn",
"options": {
"attributes": ["classList"],
"functions": ["clsx", "cva", "cn", "tv", "tw"]
}
}
}
}
}
}{
"css": {
"parser": {
"cssModules": true,
"tailwindDirectives": true
}
},
"assist": {
"actions": {
"source": {
"useSortedAttributes": "on"
}
}
},
"linter": {
"rules": {
"nursery": {
"useSortedClasses": {
"fix": "safe",
"level": "warn",
"options": {
"attributes": ["classList"],
"functions": ["clsx", "cva", "cn", "tv", "tw"]
}
}
}
}
}
}files.includes"$schema": "./node_modules/@biomejs/biome/configuration_schema.json"files.includes"$schema": "./node_modules/@biomejs/biome/configuration_schema.json".md.mdx.yml.yaml.md.mdx.yml.yaml./examples/./examples/base-config.jsonc./examples/ui-config.jsonc./examples/lint-staged.js./examples/./examples/base-config.jsonc./examples/ui-config.jsonc./examples/lint-staged.jsUse context7 to fetch Biome documentation for [specific topic]Use context7 to fetch Biome documentation for [specific topic]