sqlc-dev / sqlc-gen-typescript

364 stars 17 forks source link

Minor annoyance: an unused import is generated for pg #1

Closed KMahoney closed 11 months ago

KMahoney commented 11 months ago

Hi, thanks for this! It looks really useful.

I encountered a small issue with the 'pg' backend. This line is generated:

import { IPostgresInterval } from "postgres-interval";

If it is not used, it is a compiler error when noUnusedLocals is on.

If it is difficult to selectively include, maybe add a // @ts-ignore annotation?

kyleconroy commented 11 months ago

Congrats on Issue #1!

If it is not used, it is a compiler error when noUnusedLocals is on.

That's good to know. I thought it would just be ignored.

If it is difficult to selectively include, maybe add a // @ts-ignore annotation?

It shouldn't be too hard to import only when it's required.