prettier-plugin-sql-cst 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/syntax/data_type.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
A [Prettier][] plugin for SQL that uses [sql-parser-cst][] and the
|
|
4
4
|
actual [Prettier formatting algorithm][wadler-prettier].
|
|
5
5
|
|
|
6
|
+
**Note:** This plugin only works with Prettier 2.x. It doesn't yet support the latest Prettier 3.x.
|
|
7
|
+
|
|
6
8
|
**[Try it live!][live]**
|
|
7
9
|
|
|
8
10
|
Like Prettier for JavaScript,
|
package/dist/syntax/data_type.js
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dataTypeMap = void 0;
|
|
4
4
|
var utils_1 = require("../utils");
|
|
5
|
+
var print_utils_1 = require("../print_utils");
|
|
5
6
|
exports.dataTypeMap = {
|
|
6
7
|
// print single-word types as `TYPE(10)` and multi-word types as `MY TYPE (10)`
|
|
7
8
|
data_type: function (print, node) {
|
|
8
9
|
return ((0, utils_1.isArray)(node.nameKw) ? print.spaced : print)(["nameKw", "params"]);
|
|
9
10
|
},
|
|
10
|
-
generic_type_params: function (print) {
|
|
11
|
+
generic_type_params: function (print) {
|
|
12
|
+
return (0, print_utils_1.group)(["<", (0, print_utils_1.indent)([print_utils_1.softline, print("params")]), print_utils_1.softline, ">"]);
|
|
13
|
+
},
|
|
11
14
|
array_type_param: function (print) { return print.spaced(["dataType", "constraints"]); },
|
|
12
15
|
struct_type_param: function (print) {
|
|
13
16
|
return print.spaced(["name", "dataType", "constraints"]);
|