Closed Sec-ant closed 7 months ago
I know overrides
but it is file based overriding. However prettier-plugin-embed
aims to support formatting embedded templates of different languages in the same file.
I think that should be supported via embed
plugin, instead of reversed.
It should support an option
named overrides
for example.
I've already implemented an identifier based overriding in my plugin, ugly but working, because prettier doesn't support object type option value for plugins, so I have to use JSON.stringify
or an absolute path of a config file.
It is ok if this is not planned. Just want to check if there's a plan
Yes, I'm also using JSON.stringify
hack in the sql
plugin.
See also https://github.com/un-ts/prettier/issues/233#issuecomment-1803331128
By the way, I'm using jsox
instead of standard JSON
because it's much user friendly.
For prettier core, I've raised https://github.com/prettier/prettier/issues/14671 for tracking.
Thanks for the sharing. I'll definitely check this.
Hi @JounQin
Apologize for bothering 😂.
Some of the option names of
prettier-plugin-embed
(formatter
,language
,database
) are very common words, especially in language formatting tools like prettier. It seems prettier doesn't have namespaces for different plugins with same option names defined (correct me if I'm wrong). So if a user use this plugin with other plugins, there might be a high risk of name collisions. We were wondering if you would change them to prefixed ones likesqlFormatter
,sqlLanguage
,sqlDatabase
(or unify the latter two intosqlDialect
) to mitigate the risk.Thanks.