feat: add missing_returning plugin to enforce return value on database operations
This commit is contained in:
parent
c423a7bdb7
commit
728ba71c84
2 changed files with 14 additions and 1 deletions
|
|
@ -125,7 +125,8 @@
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"biome_plugins/missing_select.grit",
|
"biome_plugins/missing_select.grit",
|
||||||
"biome_plugins/missing_where.grit",
|
"biome_plugins/missing_where.grit",
|
||||||
"biome_plugins/null.grit"
|
"biome_plugins/null.grit",
|
||||||
|
"biome_plugins/missing_returning.grit"
|
||||||
],
|
],
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
|
|
|
||||||
12
apps/infoalloggi/biome_plugins/missing_returning.grit
Normal file
12
apps/infoalloggi/biome_plugins/missing_returning.grit
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
language js(typescript)
|
||||||
|
|
||||||
|
`$chain.$exec()` where {
|
||||||
|
$exec <: `executeTakeFirstOrThrow`,
|
||||||
|
or {
|
||||||
|
$chain <: contains `deleteFrom`,
|
||||||
|
$chain <: contains `updateTable`,
|
||||||
|
$chain <: contains `insertInto`
|
||||||
|
},
|
||||||
|
! or { $chain <: contains `returning`, $chain <: contains `returningAll` },
|
||||||
|
register_diagnostic(span=$chain, message="insert, update or delete statements must return a value on executeTakeFirstOrThrow", severity="error")
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue