Closed bakasmarius closed 7 months ago
Hi! I've thought about this before, and I decided that I didn't like the idea of being able to customize the kysely-codegen output too much. The reason is that this creates a potential rabbit hole of trying to match user expectations of what to be able to customize, e.g. formatting, line lengths, Prettier rules, ESLint rules, imports/exports etc.
In my opinion, there are better ways to handle this case:
--fix
to automatically resolve the issue. As far as I can see, consistent-type-definitions should be auto-fixable.If there is some use case I'm not taking into account, I'd be happy to hear it!
Hi, thanks for your answer and suggestions! I went with option #2 to run ESLint and prettier on the generated file, I'm wondering why I didn't think of that myself 😄
Great! 🙌
For projects that use ESLint and have @typescript-eslint/consistent-type-definitions set to use
type
s only, type definitions generated bykysely-codegen
will throw errors.It would be nice to have a CLI flag that lets the user choose whether the generated definitions will be saved as types or interfaces.
I would be more than happy to try and make a PR for this tomorrow.
Upvote & Fund