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."
"markdownDescription": "Ignore files matching these glob patterns. Current working directory is used as the root."
83
90
},
84
91
"jsxSingleQuote": {
85
92
"description": "Use single quotes instead of double quotes in JSX. (Default: `false`)",
86
93
"type": [
87
94
"boolean",
88
95
"null"
89
-
]
96
+
],
97
+
"markdownDescription": "Use single quotes instead of double quotes in JSX. (Default: `false`)"
90
98
},
91
99
"objectWrap": {
92
100
"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\"`.",
@@ -97,7 +105,8 @@ expression: json
97
105
{
98
106
"type": "null"
99
107
}
100
-
]
108
+
],
109
+
"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\"`."
101
110
},
102
111
"printWidth": {
103
112
"description": "The line length that the printer will wrap on. (Default: `100`)",
@@ -106,7 +115,8 @@ expression: json
106
115
"null"
107
116
],
108
117
"format": "uint16",
109
-
"minimum": 0.0
118
+
"minimum": 0.0,
119
+
"markdownDescription": "The line length that the printer will wrap on. (Default: `100`)"
110
120
},
111
121
"quoteProps": {
112
122
"description": "Change when properties in objects are quoted. (Default: `\"as-needed\"`)",
@@ -117,28 +127,32 @@ expression: json
117
127
{
118
128
"type": "null"
119
129
}
120
-
]
130
+
],
131
+
"markdownDescription": "Change when properties in objects are quoted. (Default: `\"as-needed\"`)"
121
132
},
122
133
"semi": {
123
134
"description": "Print semicolons at the ends of statements. (Default: `true`)",
124
135
"type": [
125
136
"boolean",
126
137
"null"
127
-
]
138
+
],
139
+
"markdownDescription": "Print semicolons at the ends of statements. (Default: `true`)"
128
140
},
129
141
"singleAttributePerLine": {
130
142
"description": "Put each attribute on a new line in JSX. (Default: `false`)",
131
143
"type": [
132
144
"boolean",
133
145
"null"
134
-
]
146
+
],
147
+
"markdownDescription": "Put each attribute on a new line in JSX. (Default: `false`)"
135
148
},
136
149
"singleQuote": {
137
150
"description": "Use single quotes instead of double quotes. (Default: `false`)",
138
151
"type": [
139
152
"boolean",
140
153
"null"
141
-
]
154
+
],
155
+
"markdownDescription": "Use single quotes instead of double quotes. (Default: `false`)"
142
156
},
143
157
"tabWidth": {
144
158
"description": "Number of spaces per indentation level. (Default: `2`)",
@@ -147,7 +161,8 @@ expression: json
147
161
"null"
148
162
],
149
163
"format": "uint8",
150
-
"minimum": 0.0
164
+
"minimum": 0.0,
165
+
"markdownDescription": "Number of spaces per indentation level. (Default: `2`)"
"description": "Use tabs for indentation or spaces. (Default: `false`)",
165
181
"type": [
166
182
"boolean",
167
183
"null"
168
-
]
184
+
],
185
+
"markdownDescription": "Use tabs for indentation or spaces. (Default: `false`)"
169
186
}
170
187
},
171
188
"allowComments": true,
@@ -222,7 +239,8 @@ expression: json
222
239
"items": {
223
240
"type": "string"
224
241
}
225
-
}
242
+
},
243
+
"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."
226
244
},
227
245
"ignoreCase": {
228
246
"default": true,
@@ -280,5 +298,6 @@ expression: json
280
298
"none"
281
299
]
282
300
}
283
-
}
301
+
},
302
+
"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