Commit e3fee04
committed
fix(lint): eliminate 5 bare
CI lint:casts reported +5 net new bare casts vs merge-base:
- 3 in relational-core/src/expression.ts (createRawSql factory)
- 1 in sql-builder/src/runtime/joined-tables-impl.ts (#addJoin)
- 1 in sql-builder/src/runtime/query-impl.ts (having())
Refactor each site to remove the cast without weakening typing:
- expression.ts: rewrite createRawSql to use values.forEach (eliminates
the values[i] cast and preserves the defence-in-depth throw on
undefined interpolations); move the builder into a RawSqlBuilderImpl
class so the overloaded returns() signatures live next to the wider
implementation signature (no per-call casts needed).
- joined-tables-impl.ts: drop the redundant 'fns as Functions<QC>' cast
(createFunctions<QC>() already returns the exact type) and prune the
now-unused Functions import.
- query-impl.ts: pass <QC> explicitly to createAggregateFunctions so its
return type is AggregateFunctions<QC> without needing a cast.
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>as casts to satisfy lint:casts ratchet1 parent 7fa065b commit e3fee04
3 files changed
Lines changed: 34 additions & 23 deletions
File tree
- packages/2-sql/4-lanes
- relational-core/src
- sql-builder/src/runtime
Lines changed: 28 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
250 | 237 | | |
251 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
| 181 | + | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
| |||
0 commit comments