Closed jjnilton closed 1 month ago
@jjnilton I think you might need to create .prettierrc
as below.
{
"plugins": ["prettier-plugin-sql"],
"overrides": [
{
"files": "*.sql",
"options": { "parser": "sql" }
}
]
}
Or you could also specify it in .dir-locals.el
without using overrides
key in .prettierrc
.
{
"plugins": ["prettier-plugin-sql"],
}
((sql-mode . ((prettier-infer-parser-flag . nil)
(prettier-parsers . (sql)))))
As far as I know, there isn't a way to pass plugins
contents from prettier.el
, so you need to create a .prettierrc
if you want to use plugins.
Describe the bug
M-x prettier-prettify-region
does not seem to work with SQL buffer (of afile.sql
) with prettier-plugin-sql installed.Link to
M-x prettier-info
output https://gist.github.com/jjnilton/757502a98e4dd4d42da436fe0aa2fc54To Reproduce Install prettier-plugin-sql and use prettier-prettify-region on a SQL region like this:
Expected behavior It should format like when using
M-x shell-command-on-region
withprettier --parser=sql
: