Closed ropbastos closed 6 months ago
I actually don't use prettier. I do it manually for performance reasons. This indeed seems like a funny issue. Thanks for posting that! I'll raise a fix soon ✌️
It's a bit more complex than I initially thought. The part that is responsible for the comparison needs to be improved. The source of the issue here is that you're transforming the type to a nested object (which should be okay).
fixed in 3.0.0-next.4
I'll close this issue when 3.0.0 will be released.
fixed in 3.0.0
Is your feature request related to a problem? Please describe. I'm trying to introduce this plugin to a code base that uses Knex and is formatted with Prettier. However, the way this extension formats the type annotation conflicts with what Prettier expects.
Using this rule:
SafeQL formats the type like this:
If I remove the
// eslint-disable-next-line prettier/prettier
the line is then formatted to:Which gives me the following error:
Describe the solution you'd like It would be nice if this plugin would generate types that are conformant to Prettier expectations, as Prettier is widely used.
Additional context Here are my ESLint and Prettier configs:
Thank you very much for this awesome plugin!