Skip to content

Checks

What SVRBC code is checked for before its tests run: its types and a lint. Builds covers how the checks run, as Bazel tests like any other, and Stack covers what the code is written in. Decided 2026-11-28; existing projects move to it when someone next works on them.

SVRBC’s code is mostly written by AI agents (Stack), and that changes what a check is for.

  • A check costs an agent nothing. It reads the error, fixes the line and runs the check again, in the same loop that wrote the code. A rule people would have worked around is no burden now. The problem is a mistake no check reports: it waits for a person to notice it.
  • So a rule has to report a mistake. The rules that used to stop arguments in review, such as import order, arrow functions or braces, have no argument left to stop: an agent writes in the style of the file it is editing. A rule like that turns style into errors, and an agent spends its effort and its diffs on them. Every rule here reports something that is wrong: a bug, or a page some people can’t use.
  • The rules that know types catch the most. What an agent gets wrong is plausible code: a promise nobody awaits, a check for null on a value that can’t be null, an any that carries a wrong shape through, or an API its training data remembers and the library has since deprecated. Only a rule that reads TypeScript’s types can tell those apart from correct code.
  • A rule the handbook states and a linter can check becomes a lint rule. A sentence in a page works only if the agent reads that page; a lint error appears on the line where the mistake is. Solid’s “never destructure props” (Islands) is solid/no-destructure.
  • A rule is turned off only with a reason. An agent whose check fails can silence it as easily as fix it. A disable comment has to say why, and the reviewer reads the reason in the diff.

TypeScript everywhere a build can check it, with strict on: the template’s tsconfig.json extends astro/tsconfigs/strict, and astro check runs in the build step (Stack). JavaScript only where the file must be: the CloudFront router and the service worker, which are served as they are, and the build’s own integrations. In Rust the compiler is the check (Stack).

ESLint, with the site template’s eslint.config.js:

  • @eslint/js’s recommended rules, plus eqeqeq.
  • typescript-eslint’s strictTypeChecked, which is type-aware (projectService). It covers floating and misused promises, unnecessary conditions, unsafe any, deprecated APIs and non-null assertions, and adds switch-exhaustiveness-check. Its stylistic presets are left out. A number or boolean in a template string is allowed, since it prints as expected.
  • eslint-plugin-astro’s recommended and jsx-a11y-recommended: the .astro files, and accessibility (an image with no alt, a link or heading with no text). Agents write markup that looks right and that a screen reader can’t read.
  • @eslint-community/eslint-plugin-eslint-comments: a disable comment says why (-- <reason>), and one that disables nothing is an error.
  • A site with islands adds eslint-plugin-solid’s typescript config for **/*.tsx. It reports destructured props (solid/no-destructure) and .map() where <For> belongs (solid/prefer-for).

The few rules that are changed for a file give their reasons in the config. Plain JavaScript has no types, so the rules about using an any are off for it and the others still apply. In an .astro file the parser sees no type for markup, so returning markup from a callback isn’t an unsafe return.

It runs as //:lint_test (scripts/bazel/eslint.sh): the code is copied into a directory of its own, astro sync writes the types an .astro file is checked against, and ESLint runs with no warnings allowed. It reads the code, the tests and the service worker, never the content (Builds), so it is cached like any test and rerun only when the code changes. Locally: npx astro sync && npx eslint ., and npx eslint --fix . for the rules that can fix themselves.

There is no shared config package. Each site has its own copy of the template’s file, which svrbc-new-site writes, and a change that should apply everywhere is made in the template first, as for the rest of a site. The file is a list of presets with a few lines of SVRBC’s own, small enough to copy. A package would need releases and an npm token, and keeping copies current costs an agent no more than bumping a version. svrbc-audit’s lint check warns for a JavaScript or TypeScript project without a type-aware config run by a Bazel test, and for one that uses @svrbc/eslint-config, which is archived.

To add it to an existing site: copy eslint.config.js and scripts/bazel/eslint.sh from the template, add the lint_test target to BUILD.bazel with that site’s code as its data, and install the template’s lint devDependencies at its versions. Then fix what it reports, with a reason on any line where a rule is turned off.

  • Formatting. No formatter is run or checked. Formatting never made a page wrong, an agent follows the formatting of the file it edits, and a formatter’s first run would rewrite every file in every site. Whether a formatter earns its place is an open question.
  • Style. No rule enforces a preference, such as import order, function style or naming. See Why.
  • Clippy (-D warnings) as a Bazel test for the Rust APIs: svrbc_rust has no clippy step.
  • A formatter (Prettier, with its Astro plugin), checked by the same test, if formatting noise in agents’ diffs turns out to cost more than one rewrite of every file.
  • TypeScript’s strictest (noUncheckedIndexedAccess, exactOptionalPropertyTypes) in the template, in place of strict.