Skip to content

Instantly share code, notes, and snippets.

@GaussianWonder
Last active March 10, 2025 14:04
Show Gist options
  • Save GaussianWonder/6fbd12d90fd78ea8d98930e66772530e to your computer and use it in GitHub Desktop.
Save GaussianWonder/6fbd12d90fd78ea8d98930e66772530e to your computer and use it in GitHub Desktop.
Opinionated biome.js config. Works well for both frontend and backend services.
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"recommended": true,
"noExtraBooleanCast": "warn",
"noStaticOnlyClass": "off",
"noThisInStatic": "error",
"noUselessCatch": "error",
"noUselessSwitchCase": "warn",
"noUselessTernary": "warn",
"useArrowFunction": "error",
"useLiteralKeys": "warn",
"useSimplifiedLogicExpression": "warn"
},
"correctness": {
"recommended": true,
"noNodejsModules": "off",
"useIsNan": "error",
"useYield": "error"
},
"performance": {
"recommended": true,
"noAccumulatingSpread": "error"
},
"style": {
"recommended": true,
"noDefaultExport": "off",
"noNegationElse": "error",
"noNonNullAssertion": "warn",
"noShoutyConstants": "error",
"noUnusedTemplateLiteral": "error",
"noVar": "error",
"noUselessElse": "error",
"useConsistentArrayType": "error",
"useConst": "error",
"useExportType": "error",
"useFilenamingConvention": "error",
"useImportType": "error",
"useNamingConvention": "off",
"useNodejsImportProtocol": "error",
"useNumberNamespace": "error",
"useShorthandArrayType": "error",
"useShorthandAssign": "error",
"useShorthandFunctionType": "error"
},
"suspicious": {
"recommended": true,
"noCatchAssign": "error",
"noDoubleEquals": "error",
"noExplicitAny": "warn",
"noFallthroughSwitchClause": "off",
"noGlobalIsFinite": "error",
"useAwait": "warn",
"useIsArray": "error",
"useDefaultSwitchClauseLast": "error"
},
"nursery": {
"recommended": true,
"noSubstr": "error",
"useDeprecatedReason": "error"
}
}
},
"formatter": {
"enabled": true,
"lineEnding": "lf",
"indentStyle": "space",
"lineWidth": 100
},
"javascript": {
"formatter": {
"enabled": true,
"trailingCommas": "all",
"semicolons": "always",
"quoteStyle": "double",
"bracketSpacing": true,
"arrowParentheses": "asNeeded"
},
"linter": {
"enabled": true
}
},
"json": {
"formatter": {
"enabled": true,
"trailingCommas": "none"
},
"linter": {
"enabled": true
},
"parser": {
"allowComments": true
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
{
"files.exclude": {
"**/*.tsbuildinfo": true,
"**/.git": true
},
"search.exclude": {
"**/node_modules": true,
"**/*.tsbuildinfo": true,
"**/*.code-search": true
},
"editor.formatOnType": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"files.autoSave": "onFocusChange",
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "always",
"source.fixAll.biome": "explicit"
},
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace",
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
@GaussianWonder
Copy link
Author

GaussianWonder commented Mar 10, 2025

If there are two instances of biomejs running, it might be related to the Dev Containers extension, disabling that will probably fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment