[BUG] Unused import type { Prisma } from './client
incompatible with verbatimModuleSyntax
is being generated
#273
Labels
bug (unconfirmed)
Could be a bug
Describe the bug
When the index.ts is generated the start of the file looks like the following:
The second import is not only useless as the Prisma type is not used anywhere on the file but it is also incompatible with tsconfig option
verbatimModuleSyntax
as the ESM standard requires specifying the file extension so it should beimport type { Prisma } from './client/index.js';
This makes code quality tools report an unused import and tsc to error due to
verbatimModuleSyntax
.Package versions (please complete the following information):
Additional context
Generators defined on my prisma schema:
This can be easily fixed by changing lines 19 and 21 at https://github.com/chrishoermann/zod-prisma-types/blob/master/packages/generator/src/functions/writeSingleFileImportStatements.ts
The text was updated successfully, but these errors were encountered: