Lint plugins
Lint plugins
warpkit's own conventions that a pattern in the code can show are Biome plugins, written in GritQL, in biome-plugins/. They run inside make lint and show in the editor, and unlike a grep they match the code's structure: a call split over lines, a comment, or a string that happens to contain the pattern do not fool them.
| Plugin | Files | Rule |
|---|---|---|
error-codes | all | err() takes an ERROR_CODES.* constant, never a raw string |
barrel-pages | src/features/*/index.ts | a feature barrel does not export a page component |
prefetch-bare | src/routes/** | prefetchQuery / ensureQueryData take a queryOptions() factory |
no-test-sleep | *.test.ts(x) | a test does not wait on real time |
no-unreasoned-effect | src/** | every useEffect says what outside React it keeps in step |
The files each plugin runs on are set in biome.jsonc (plugins, includes).
Writing one
- The message is read by whoever broke the rule, often an agent: say what to do instead, not only what is wrong.
- Add a case to
biome-plugins/plugins.test.ts: one fixture that must be flagged and one that must not. The test lints the fixtures at their real paths, so theincludesinbiome.jsoncare tested too. - Add the
.gritfile totemplate-sync.json, so the other apps get it withmake template.update.
A rule that reads across files, a comment, or the built app stays a make check-* script: GritQL sees one file's syntax and not its comments.
Keeping one exception
// biome-ignore lint/plugin/no-test-sleep: the timer is what this test is about
The name after lint/plugin/ is the plugin's file name. Always say why.