You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(oxfmt): Add markdownDescription fields and unify the schema generation process.
With this change, the descriptions for each field in the JSON schema are rendered with proper markdown formatting in VS Code and other editors based on VS Code.
This now matches the implementation for the Oxlintrc schema generation.
Copy file name to clipboardExpand all lines: crates/oxc_formatter/tests/snapshots/schema_json.snap
+38-19Lines changed: 38 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -17,21 +17,24 @@ expression: json
17
17
{
18
18
"type": "null"
19
19
}
20
-
]
20
+
],
21
+
"markdownDescription": "Include parentheses around a sole arrow function parameter. (Default: `\"always\"`)"
21
22
},
22
23
"bracketSameLine": {
23
24
"description": "Put the `>` of a multi-line JSX element at the end of the last line\ninstead of being alone on the next line. (Default: `false`)",
24
25
"type": [
25
26
"boolean",
26
27
"null"
27
-
]
28
+
],
29
+
"markdownDescription": "Put the `>` of a multi-line JSX element at the end of the last line\ninstead of being alone on the next line. (Default: `false`)"
28
30
},
29
31
"bracketSpacing": {
30
32
"description": "Print spaces between brackets in object literals. (Default: `true`)",
31
33
"type": [
32
34
"boolean",
33
35
"null"
34
-
]
36
+
],
37
+
"markdownDescription": "Print spaces between brackets in object literals. (Default: `true`)"
35
38
},
36
39
"embeddedLanguageFormatting": {
37
40
"description": "Control whether formats quoted code embedded in the file. (Default: `\"auto\"`)",
@@ -42,7 +45,8 @@ expression: json
42
45
{
43
46
"type": "null"
44
47
}
45
-
]
48
+
],
49
+
"markdownDescription": "Control whether formats quoted code embedded in the file. (Default: `\"auto\"`)"
46
50
},
47
51
"endOfLine": {
48
52
"description": "Which end of line characters to apply. (Default: `\"lf\"`)",
@@ -53,7 +57,8 @@ expression: json
53
57
{
54
58
"type": "null"
55
59
}
56
-
]
60
+
],
61
+
"markdownDescription": "Which end of line characters to apply. (Default: `\"lf\"`)"
57
62
},
58
63
"experimentalSortImports": {
59
64
"description": "Experimental: Sort import statements. Disabled by default.",
@@ -64,7 +69,8 @@ expression: json
64
69
{
65
70
"type": "null"
66
71
}
67
-
]
72
+
],
73
+
"markdownDescription": "Experimental: Sort import statements. Disabled by default."
68
74
},
69
75
"ignorePatterns": {
70
76
"description": "Ignore files matching these glob patterns. Current working directory is used as the root.",
@@ -74,14 +80,16 @@ expression: json
74
80
],
75
81
"items": {
76
82
"type": "string"
77
-
}
83
+
},
84
+
"markdownDescription": "Ignore files matching these glob patterns. Current working directory is used as the root."
78
85
},
79
86
"jsxSingleQuote": {
80
87
"description": "Use single quotes instead of double quotes in JSX. (Default: `false`)",
81
88
"type": [
82
89
"boolean",
83
90
"null"
84
-
]
91
+
],
92
+
"markdownDescription": "Use single quotes instead of double quotes in JSX. (Default: `false`)"
85
93
},
86
94
"objectWrap": {
87
95
"description": "How to wrap object literals when they could fit on one line or span multiple lines. (Default: `\"preserve\"`)\nNOTE: In addition to Prettier's `\"preserve\"` and `\"collapse\"`, we also support `\"always\"`.",
@@ -92,7 +100,8 @@ expression: json
92
100
{
93
101
"type": "null"
94
102
}
95
-
]
103
+
],
104
+
"markdownDescription": "How to wrap object literals when they could fit on one line or span multiple lines. (Default: `\"preserve\"`)\nNOTE: In addition to Prettier's `\"preserve\"` and `\"collapse\"`, we also support `\"always\"`."
96
105
},
97
106
"printWidth": {
98
107
"description": "The line length that the printer will wrap on. (Default: `100`)",
@@ -101,7 +110,8 @@ expression: json
101
110
"null"
102
111
],
103
112
"format": "uint16",
104
-
"minimum": 0.0
113
+
"minimum": 0.0,
114
+
"markdownDescription": "The line length that the printer will wrap on. (Default: `100`)"
105
115
},
106
116
"quoteProps": {
107
117
"description": "Change when properties in objects are quoted. (Default: `\"as-needed\"`)",
@@ -112,28 +122,32 @@ expression: json
112
122
{
113
123
"type": "null"
114
124
}
115
-
]
125
+
],
126
+
"markdownDescription": "Change when properties in objects are quoted. (Default: `\"as-needed\"`)"
116
127
},
117
128
"semi": {
118
129
"description": "Print semicolons at the ends of statements. (Default: `true`)",
119
130
"type": [
120
131
"boolean",
121
132
"null"
122
-
]
133
+
],
134
+
"markdownDescription": "Print semicolons at the ends of statements. (Default: `true`)"
123
135
},
124
136
"singleAttributePerLine": {
125
137
"description": "Put each attribute on a new line in JSX. (Default: `false`)",
126
138
"type": [
127
139
"boolean",
128
140
"null"
129
-
]
141
+
],
142
+
"markdownDescription": "Put each attribute on a new line in JSX. (Default: `false`)"
130
143
},
131
144
"singleQuote": {
132
145
"description": "Use single quotes instead of double quotes. (Default: `false`)",
133
146
"type": [
134
147
"boolean",
135
148
"null"
136
-
]
149
+
],
150
+
"markdownDescription": "Use single quotes instead of double quotes. (Default: `false`)"
137
151
},
138
152
"tabWidth": {
139
153
"description": "Number of spaces per indentation level. (Default: `2`)",
@@ -142,7 +156,8 @@ expression: json
142
156
"null"
143
157
],
144
158
"format": "uint8",
145
-
"minimum": 0.0
159
+
"minimum": 0.0,
160
+
"markdownDescription": "Number of spaces per indentation level. (Default: `2`)"
"description": "Use tabs for indentation or spaces. (Default: `false`)",
160
176
"type": [
161
177
"boolean",
162
178
"null"
163
-
]
179
+
],
180
+
"markdownDescription": "Use tabs for indentation or spaces. (Default: `false`)"
164
181
}
165
182
},
166
183
"allowComments": true,
@@ -217,7 +234,8 @@ expression: json
217
234
"items": {
218
235
"type": "string"
219
236
}
220
-
}
237
+
},
238
+
"markdownDescription": "Custom groups configuration for organizing imports.\nEach array element represents a group, and multiple group names in the same array are treated as one.\nAccepts both `string` and `string[]` as group elements."
221
239
},
222
240
"ignoreCase": {
223
241
"default": true,
@@ -275,5 +293,6 @@ expression: json
275
293
"none"
276
294
]
277
295
}
278
-
}
296
+
},
297
+
"markdownDescription": "Configuration options for the formatter.\nMost options are the same as Prettier's options.\nSee also <https://prettier.io/docs/options>"
0 commit comments