Closed3
GritQLでResult型を強制したかった
Biomev2.0以降で使えるplugin機能を使ってGritQLのカスタムLintが作れるようになった
これを使って非同期処理のResult化の漏れを防ぎたい。
BiomeのGritQL Engineの実装状況
ただ型レベルで制御はできないので、一旦シンプルにPromiseの型注釈がある場合はLintでエラーを出すようにする。
`Promise<$type>` where {
$type <: not `Result<$_, $_>`,
register_diagnostic(
span = $type,
message = "Promise return type must use Result<T, AppError>. Use Promise<Result<T, AppError>> instead of Promise<T>"
)
}
try構文の使用防止
language js
`try { $body }` where {
register_diagnostic(
span = `try { $body }`,
message = "Try statements are not allowed. Use Result<T, AppError> pattern instead for error handling"
)
}
Rewrites
The operator works and effects are being produced, but we don't apply them yet. See TODO comment in grit_context.rs
とあるので自動修復はまだ使えない。
Issueはある
このスクラップは2025/07/24にクローズされました