BEEQ enforces consistent code style with a combination of automated tools. The golden rule: follow the style you already see in the repository. Consistency with the rest of the project always takes precedence.
Tools
| Tool | Purpose |
|---|
| Biome | Linting and formatting for TypeScript / TSX / JS / JSX |
| Stylelint | Linting for SCSS stylesheets |
| EditorConfig | Editor-agnostic baseline (indentation, line endings) |
Prettier was previously used for formatting but has been replaced by Biome. If you see references to Prettier in older parts of the codebase, prefer Biome’s formatter instead.
Biome
Biome handles formatting and linting for all .ts, .tsx, .js, and .jsx files. The full configuration is in biome.json at the repository root.
Formatting rules
{
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 120,
"lineEnding": "lf",
"bracketSpacing": true,
"bracketSameLine": false
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always"
}
}
}
Linting rules
Biome runs with the recommended ruleset plus several project-specific overrides:
| Rule | Severity | Description |
|---|
noUnusedImports | error | Remove any import that is not referenced |
noUnusedVariables | error | Remove any variable that is not used |
noUselessConstructor | error | Remove constructors that do nothing |
useImportType | error | Use import type for type-only imports |
useNodejsImportProtocol | error | Use node: prefix for Node.js built-ins |
noExcessiveCognitiveComplexity | warn | Keep functions readable |
noUnusedPrivateClassMembers | warn | Remove unused private members |
noExplicitAny | warn | Avoid any type annotations |
Import order
Biome’s organizeImports assist action enforces this import group order:
- Node.js built-ins (e.g.,
node:path)
- (blank line)
- Third-party packages
- (blank line)
- Aliased internal modules
- Parent-directory relative imports (
../)
- Same-directory relative imports (
./)
- (blank line)
- Index re-exports (
./index)
Naming conventions
Biome enforces naming conventions across the codebase:
| Symbol kind | Allowed formats |
|---|
| Classes | PascalCase |
| Private class properties | camelCase, CONSTANT_CASE |
const declarations | camelCase, PascalCase, CONSTANT_CASE |
| Function parameters | camelCase, CONSTANT_CASE |
| Interfaces | PascalCase |
| Type aliases | PascalCase |
| Type parameters | PascalCase, CONSTANT_CASE |
Stylelint
Stylelint is used for all SCSS files inside the component scss/ directories. Run it via NX:
nx run-many --target=lint --all
Follow the existing SCSS patterns in the component files. Keep selectors scoped to the component and use CSS custom properties for any value that should be themeable.
EditorConfig
The .editorconfig file at the root sets baseline formatting rules that most editors respect automatically:
- 2-space indentation
- LF line endings
- UTF-8 charset
- Trim trailing whitespace
- Insert final newline
If your editor supports EditorConfig (VS Code, JetBrains IDEs, Vim, etc.), these settings are applied automatically.
Running code style checks
# Lint all projects
nx run-many --target=lint --all
# Lint affected projects only
nx affected --target=lint