Linting
Biome formats and lints Litestore's code, with one command to run while you work and another before you push.
Litestore formats and lints its code with Biome. The sections below describe the Biome configuration and which command to run while you work and before you push.
The repository has no ESLint or Prettier configuration. Biome handles both jobs, and its settings are in biome.json. TypeScript checks the types separately through bun run typecheck.
Biome
biome.json uses the 1.9.4 schema, which matches the installed @biomejs/biome (^1.9.4).
"formatter": {
"enabled": true,
"lineWidth": 100,
"indentStyle": "space",
"indentWidth": 2,
"formatWithErrors": true
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "asNeeded",
"arrowParentheses": "asNeeded",
"bracketSpacing": true,
"trailingCommas": "all"
}
}For JavaScript and TypeScript, Biome formats code like this.
| Setting | What Biome does | Value |
|---|---|---|
lineWidth | It wraps lines at this width. | 100 columns |
indentStyle, indentWidth | It indents with spaces. | Two spaces |
quoteStyle | It writes strings with this quote. | Double quotes |
semicolons | It writes semicolons only where they are required. | asNeeded |
arrowParentheses | It leaves out parentheses around a single arrow function parameter. | asNeeded |
trailingCommas | It writes trailing commas everywhere they are allowed. | all |
Because formatWithErrors is on, Biome still formats a file that doesn't parse, as far as it can.
JSON has its own settings. The parser accepts trailing commas but the formatter never writes them, and the parser rejects comments.
organizeImports is on, so Biome sorts imports and nobody has to keep them in order by hand.
vcs.useIgnoreFile is on with clientKind: "git", so Biome respects .gitignore. files.ignore adds three more paths:
**/.next
**/.source
**/woocommerce-product-feeds/**Disabled rules
The linter runs Biome's recommended rules with eleven of them turned off.
| Group | Rules turned off |
|---|---|
| suspicious | noExplicitAny, noArrayIndexKey, noConfusingLabels, noShadowRestrictedNames |
| correctness | useExhaustiveDependencies |
| security | noDangerouslySetInnerHtml |
| style | noNonNullAssertion |
| a11y | noBlankTarget, useAnchorContent, useValidAnchor, useAltText |
noDangerouslySetInnerHtml is off because Litestore cleans the HTML it renders with sanitize-html before it reaches the page.
Commands
bun run formatThis runs biome format --write .. It only formats the code and doesn't run the linter.
Use lint while you work and verify before you push. GitHub Actions runs verify on every push to main and on every pull request, so running it locally shows the same failures CI would report.
Type checking is separate from Biome and needs extra memory:
"typecheck": "NODE_OPTIONS='--max-old-space-size=5000' tsc --noEmit"On a machine with little memory, stop the dev server before you run it.
The repository doesn't install Git hooks, so nothing runs automatically when you commit or push. CI is where verify has to pass.
Quick reference
Related
Style
The codebase follows conventions for naming, imports and file layout.
Continuous integration
CI runs checks on every push, and the repository gives AI coding agents guides to follow.
Commands
Every script in package.json, from the dev server and database scripts to lint and verify, has a specific use.