Commit ef0dc07
chore(lint): enforce command output conventions via Biome plugins (#439)
Enforce PR #433 `buildCommand` conventions via lint rules that run as
part of `bun run lint`:
## GritQL Plugins (new)
Two Biome GritQL plugins in `lint-rules/` ban anti-patterns in
`src/commands/`:
- **`no-stdout-write-in-commands`** — commands should yield
`CommandOutput`, not call `stdout.write()` directly
- **`no-process-stdout-in-commands`** — commands should not access
`process.stdout`
Both use `file($name, $body)` scoping so they only fire on command files
and produce inline editor diagnostics.
> **Note on Biome GritQL:** bare `$filename` / `$program` metavariables
don't work in Biome 2.3.8 plugins (they cause "didn't specify a valid
span" errors). The `file($name, $body)` pattern is the correct approach
— `$name` contains the full absolute path so regex needs `.*` anchors.
## noRestrictedImports (new)
Biome override bans `chalk` imports in `src/commands/**/*.ts`, directing
developers to `colorTag()` from the markdown rendering pipeline which
respects `NO_COLOR` / `SENTRY_PLAIN_OUTPUT`.
## Bug fix
Fix `muted()` usage in `src/commands/issue/view.ts` to use the
`isPlainOutput()` pattern, so span-tree fallback messages don't leak
ANSI codes in plain-output mode.1 parent cd646f7 commit ef0dc07
4 files changed
Lines changed: 44 additions & 4 deletions
File tree
- lint-rules
- src/commands/issue
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
80 | 109 | | |
81 | 110 | | |
82 | 111 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
0 commit comments