Closed ssukienn closed 2 years ago
https://unpkg.com/browse/prettier-plugin-sql@0.9.0/lib/languages.js
These files are supported for now, not sql
tag, and I don't know what it is.
You should add some references for it as a feature request.
Maybe you mean https://github.com/ruimarinho/sql-tag
Maybe you mean https://github.com/ruimarinho/sql-tag
H, yes, thanks for the response. That was exactly my question regarding TS files. That or other (chosen tags) but also normal string literals (why not, if you can see that given string is an SQL query).
From what I can see this plugin is working for SQL related file types so not sure if that would be even in scope.
As this is more complicated with finding SQL in syntax of specific language where there could be strings with expressions that might not be direct correct SQL, but you would like to format them anyway i.e. TS string literal: select ${cols} from ${tab}${whereWithConditions}
.
Was looking for something more robust than https://www.npmjs.com/package/eslint-plugin-sql which is quite buggy and unmaintained. It is using eslint to parse ts files. I know prettier is doing it a little differently.
This is a good-to-have feature request, it requires to extends babel
and typescript
related parsers.
But it's not in high priority to me, so it would be great if you can raise a PR for it.
I'd like to offer some help if you need.
How html
tag work in prettier
core would just be helpful.
Thanks for the encouragement and the kind offer but definitely won't have a capacity to dedicate time here :)
Then no one would offer any effort here.
Hi. Does this plugin works only for
*.sql
files or is it also capable of formatting inline sql in javascript/typescript string, literal tag (i.e. sql`...`)?