Tools Lint
Tools Lint Shared Biome configuration for consistent formatting and linting across the vitus-labs ecosystem.
@vitus-labs/tools-lint provides a shareable Biome configuration preset for JavaScript, TypeScript, JSON, and CSS. It enforces consistent formatting and strict linting rules while allowing per-project overrides.
npm install @vitus-labs/tools-lint
Extend the shared config in your project's biome.json:
{
"$schema" : "https://biomejs.dev/schemas/2.4.7/schema.json" ,
"extends" : [ "@vitus-labs/tools-lint/biome" ]
}
Run linting:
# Check all files
biome check .
# Auto-fix issues
biome check . --fix
# Format only
biome format .
Setting Value Example Quote style Single 'hello'JSX quotes Double <Button type="submit" />Semicolons As needed const x = 1 (no trailing ;)Trailing commas All { a, b, c, }Bracket spacing Yes { a } not {a}Arrow parens Always (x) => x not x => xIndent 2 spaces — Line width 80 chars — Line endings LF Unix-style
Setting Value Trailing commas None (spec-compliant) Indent 2 spaces
Setting Value Quotes Single Indent 2 spaces Linting Enabled
Rules are organized by category. The preset enables Biome's recommended baseline plus custom overrides.
Rule Severity Description noUnusedVariableserror Remove unused variables noUnusedImportserror Remove unused imports noUndeclaredVariableserror Catch undefined variable references useHookAtTopLevelerror Enforce React Rules of Hooks
Rule Severity Description noParameterAssignerror Prevent function parameter reassignment useConsistentArrayTypeerror Enforce Type[] shorthand over Array<Type> noNonNullAssertionwarn Flag value! non-null assertions useDefaultParameterLastoff Allows any parameter ordering noUnusedTemplateLiteraloff Allows template syntax for strings useFilenamingConventionoff Flexible file naming useNamingConventionoff No variable naming conventions enforced
Rule Severity Description noExcessiveCognitiveComplexitywarn Flag overly complex logic useFlatMaperror Use .flatMap() over .map().flat() noForEachoff .forEach() is allowed
Rule Severity Description noExplicitAnyoff any type is allowednoArrayIndexKeywarn Flag array index as React key noConsolewarn Flag console usage noEmptyBlockStatementswarn Flag empty {} blocks
Rule Severity Description noDangerouslySetInnerHtmlerror Prevent XSS via dangerouslySetInnerHTML
Rule Severity Description useAltTexterror Require alt on <img> useAnchorContenterror Require text in <a> elements useButtonTypewarn Require type on <button>
Rule Severity Description noAccumulatingSpreadoff Allows {...a, ...b} patterns
Rule Severity Description noShadowwarn Flag variable shadowing
The preset declares build-time injected globals to prevent linter errors:
Variable Purpose __BROWSER__Runtime platform flag __NATIVE__Runtime platform flag __NODE__Runtime platform flag __WEB__Runtime platform flag __CLIENT__Client-side execution flag __VERSION__Build version injection __VITUS_LABS_STORIES__Storybook environment flag
The preset enables automatic import organization:
"assist" : {
"actions" : {
"source" : {
"organizeImports" : "on"
}
}
}
Triggered via biome check --fix — sorts imports alphabetically and removes duplicates.
Each project can extend and override specific rules without affecting others. Biome deep-merges rule objects:
{
"extends" : [ "@vitus-labs/tools-lint/biome" ],
"javascript" : {
"globals" : [ "vi" , "describe" , "it" , "expect" ]
},
"linter" : {
"rules" : {
"suspicious" : {
"noConsole" : "off"
},
"nursery" : {
"noShadow" : "off"
}
}
}
}
Common overrides:
Context Override Why CLI tools noConsole: "off"Console output is intentional Test files Add vi, describe, it, expect to globals Vitest global APIs Legacy code noShadow: "off"Many valid shadowing cases Content sites noDangerouslySetInnerHtml: "warn"CMS/markdown rendering