mirror of
https://github.com/withastro/astro.git
synced 2025-12-05 18:56:38 -06:00
167 lines
3.6 KiB
JSON
167 lines
3.6 KiB
JSON
{
|
|
"$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
|
|
"files": {
|
|
"includes": [
|
|
"**",
|
|
"!**/vendor",
|
|
"!!**/smoke",
|
|
"!!**/fixtures",
|
|
"!!**/fixture",
|
|
"!!**/_temp-fixtures",
|
|
"!!**/dist",
|
|
"packages/language-tools/vscode/syntaxes/*.json",
|
|
"!!**/.vscode-test"
|
|
]
|
|
},
|
|
"vcs": {
|
|
"enabled": true,
|
|
"clientKind": "git",
|
|
"useIgnoreFile": true
|
|
},
|
|
"formatter": {
|
|
"indentStyle": "tab",
|
|
"indentWidth": 2,
|
|
"lineWidth": 100,
|
|
"includes": ["**", "!**/.changeset", "!**/pnpm-lock.yaml", "!**/*.astro"],
|
|
"expand": "auto"
|
|
},
|
|
"assist": {
|
|
"actions": {
|
|
"source": {
|
|
"organizeImports": "on"
|
|
}
|
|
}
|
|
},
|
|
"linter": {
|
|
"enabled": true,
|
|
|
|
"domains": {
|
|
"test": "recommended"
|
|
},
|
|
"rules": {
|
|
"recommended": false,
|
|
"style": {
|
|
"useNodejsImportProtocol": "error",
|
|
// Enforce separate type imports for type-only imports to avoid bundling unneeded code
|
|
"useImportType": "error"
|
|
},
|
|
"suspicious": {
|
|
// This one is specific to catch `console.log`. The rest of logs are permitted
|
|
"noConsole": {
|
|
"level": "warn",
|
|
"options": {
|
|
"allow": ["error", "warn", "info", "debug"]
|
|
}
|
|
}
|
|
},
|
|
"correctness": {
|
|
"noUnusedVariables": {
|
|
"level": "error",
|
|
"options": {
|
|
"ignoreRestSiblings": true
|
|
}
|
|
},
|
|
"noUnusedFunctionParameters": "error",
|
|
"noUnusedImports": "error"
|
|
}
|
|
}
|
|
},
|
|
"javascript": {
|
|
"formatter": {
|
|
"trailingCommas": "all",
|
|
"quoteStyle": "single",
|
|
"semicolons": "always"
|
|
}
|
|
},
|
|
"json": {
|
|
"parser": {
|
|
"allowComments": true,
|
|
"allowTrailingCommas": true
|
|
},
|
|
"formatter": {
|
|
"indentStyle": "space",
|
|
"trailingCommas": "none"
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
// Workaround to format files like npm does
|
|
"includes": ["**/package.json"],
|
|
"json": {
|
|
"formatter": {
|
|
"expand": "always"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"includes": ["**/*.astro", "**/*.vue", "**/*.svelte"],
|
|
"formatter": {
|
|
"enabled": false
|
|
},
|
|
"linter": {
|
|
"rules": {
|
|
"correctness": {
|
|
"noUnusedVariables": "off",
|
|
"noUnusedImports": "off"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
// We don't want to have node modules in code that should be runtime agnostic
|
|
"includes": [
|
|
"**/packages/astro/src/**/runtime/**/*.ts",
|
|
"**/packages/astro/src/**/runtime.ts"
|
|
],
|
|
"linter": {
|
|
"rules": {
|
|
"correctness": {
|
|
"noNodejsModules": "error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"includes": ["**/*.astro", "**/client.d.ts", "**/jsx-runtime.d.ts"],
|
|
"linter": {
|
|
"rules": {
|
|
"correctness": {
|
|
"noUnusedVariables": "off",
|
|
"noUnusedImports": "off"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"includes": ["**/packages/integrations/**/*.ts"],
|
|
"linter": {
|
|
"rules": {
|
|
"suspicious": {
|
|
"noConsole": {
|
|
"level": "error",
|
|
"options": {
|
|
"allow": ["warn", "error", "info", "debug"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"includes": [
|
|
"**/packages/db/**/cli/**/*.ts",
|
|
"**/benchmark/**/*.js",
|
|
"**/packages/astro/src/cli/**/*.ts",
|
|
"**/packages/astro/astro.js"
|
|
],
|
|
"linter": {
|
|
"rules": {
|
|
"suspicious": {
|
|
"noConsole": "off"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|