@onrails/biome-plugin
v0.1.3
Published
Biome GritQL plugin: boundary diagnostics for @onrails/result (Promise<Result<…>>, _unsafeUnwrap*).
Downloads
435
Maintainers
Readme
@onrails/biome-plugin
Biome GritQL rules for @onrails/result boundaries — mirrors @onrails/eslint-plugin for projects that lint with Biome.
Install
bun add -d @onrails/biome-plugin @biomejs/biomeUse
Reference the rule files in biome.json plugins:
{
"plugins": [
"./node_modules/@onrails/biome-plugin/rules/no-promise-result.grit",
"./node_modules/@onrails/biome-plugin/rules/no-unsafe-unwrap.grit",
"./node_modules/@onrails/biome-plugin/rules/no-deprecated-synonyms.grit",
"./node_modules/@onrails/biome-plugin/rules/fluent-stays-local.grit"
]
}Rules
| Rule | What it catches |
|------|------------------|
| no-promise-result | Promise<Result<T, E>> in any type position — return ResultAsync<T, E> and use fromAsync / tryAsync at the boundary (error) |
| no-unsafe-unwrap | ._unsafeUnwrap() / ._unsafeUnwrapErr() calls — use match / resolve / yieldResult instead (error) |
| no-deprecated-synonyms | Deprecated synonyms (chain, fold, getOrElse, of, …) — use the canonical names (error) |
| fluent-stays-local | Bare FluentResult<…> / FluentMaybe<…> type references — broader net than the ESLint rule, see ENGINE_DIVERGENCES (error) |
Tests
Fixtures under test/fixtures/{valid,invalid}/ (isolated biome.json with root: true). Tests in test/rules.spec.ts shell out to biome lint --reporter=json from that directory and assert message substrings.
