Skip to content

Commit

Permalink
fix #142
Browse files Browse the repository at this point in the history
  • Loading branch information
baiy committed Jul 25, 2022
1 parent 6bc7ec4 commit 66c0154
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/tool/library/formatter/sql.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import prettier from "prettier/standalone";
import parserSql from "prettier-plugin-sql";

export const beautify = (code, option = {}) => {
return prettier.format(code, {
plugins: [parserSql],
parser: "sql",
language: "mysql",
tabWidth: "tab" in option ? option.tab : 4
});
}
Expand All @@ -13,5 +15,5 @@ export const compress = (code, options = {}) => {
}

export default {
beautify,compress
beautify, compress
}

0 comments on commit 66c0154

Please sign in to comment.