1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
| const prettierrc = { $schema: "http://json-schema.org/draft-04/schema#", definitions: { optionsDefinition: { type: "object", properties: { arrowParens: { description: "在箭头函数单参数周围包括括号。", default: "always", oneOf: [ { enum: ["always"], description: "始终包括括号。示例: `(x) => x`", }, { enum: ["avoid"], description: "尽可能省略括号。示例:`x => x`", }, ], }, bracketSameLine: { description: "将>的开始标记放在最后一行,而不是放在新一行。", default: false, type: "boolean", }, bracketSpacing: { description: "在括号之间打印空格。", default: true, type: "boolean", }, cursorOffset: { description: "打印(到stderr),在格式化后,给定位置的光标将移动到该位置。此选项不能与--range start和--range end一起使用。", default: -1, type: "integer", }, editorconfig: { description: "是否分析项目中的.editorconfig文件并将其财产转换为相应的Prettier配置。此配置将被.fileterrc等覆盖。", default: false, type: "boolean", }, embeddedLanguageFormatting: { description: "控制Prettier如何格式化嵌入文件中的引用代码。", default: "auto", oneOf: [ { enum: ["auto"], description: "如果Prettier能够自动识别嵌入代码,则设置嵌入代码的格式。", }, { enum: ["off"], description: "永远不要自动格式化嵌入的代码。", }, ], }, endOfLine: { description: "要应用的行尾字符。", default: "lf", oneOf: [ { enum: ["lf"], description: "仅限换行符(\n),在Linux和macOS上以及git repos内部常见", }, { enum: ["crlf"], description: "回车+换行字符(\r\n),在Windows上常见", }, { enum: ["cr"], description: "仅限回车符(\r),很少使用", }, { enum: ["auto"], description: "维护现有\n(一个文件中的混合值通过查看第一行之后使用的内容进行标准化)", }, ], }, filepath: { description: "指定输入文件路径。这将用于进行解析器推理。", type: "string", }, htmlWhitespaceSensitivity: { description: "如何处理HTML中的空白。", default: "css", oneOf: [ { enum: ["css"], description: "尊重CSS显示属性的默认值。", }, { enum: ["strict"], description: "空白被认为是敏感的。", }, { enum: ["ignore"], description: "空白被认为是不敏感的。", }, ], }, insertPragma: { description: "在文件的第一个文档块注释中插入@format pragma。", default: false, type: "boolean", }, jsxSingleQuote: { description: "在JSX中使用单引号。", default: false, type: "boolean", }, parser: { description: "要使用的解析器。", anyOf: [ { enum: ["flow"], description: "Flow", }, { enum: ["babel"], description: "JavaScript", }, { enum: ["babel-flow"], description: "Flow", }, { enum: ["babel-ts"], description: "TypeScript", }, { enum: ["typescript"], description: "TypeScript", }, { enum: ["acorn"], description: "JavaScript", }, { enum: ["espree"], description: "JavaScript", }, { enum: ["meriyah"], description: "JavaScript", }, { enum: ["css"], description: "CSS", }, { enum: ["less"], description: "Less", }, { enum: ["scss"], description: "SCSS", }, { enum: ["json"], description: "JSON", }, { enum: ["json5"], description: "JSON5", }, { enum: ["json-stringify"], description: "JSON.stringify", }, { enum: ["graphql"], description: "GraphQL", }, { enum: ["markdown"], description: "Markdown", }, { enum: ["mdx"], description: "MDX", }, { enum: ["vue"], description: "Vue", }, { enum: ["yaml"], description: "YAML", }, { enum: ["glimmer"], description: "Ember / Handlebars", }, { enum: ["html"], description: "HTML", }, { enum: ["angular"], description: "Angular", }, { enum: ["lwc"], description: "Lightning Web Components", }, { type: "string", description: "Custom parser", }, ], }, pluginSearchDirs: { description: "在node_modules子目录中包含更漂亮插件的自定义目录。Overrides在相对于Prettier的位置搜索插件时的默认行为。可接受多个值。", default: [], oneOf: [ { type: "array", items: { type: "string", }, }, { enum: [false], description: "禁用插件自动加载。", }, ], }, plugins: { description: "添加一个插件。多个插件可以作为单独的`--plugin`传递。", default: [], type: "array", items: { type: "string", }, }, printWidth: { description: "一行超过设置值长度将尝试进行换行。", default: 80, type: "integer", }, proseWrap: { description: "如何包装散文。", default: "preserve", oneOf: [ { enum: ["always"], description: "如果超过打印宽度,请换行。", }, { enum: ["never"], description: "不要把散文包装起来。", }, { enum: ["preserve"], description: "按原样包装散文。", }, ], }, quoteProps: { description: "当对象中的属性被引用时更改。", default: "as-needed", oneOf: [ { enum: ["as-needed"], description: "只在需要的地方在对象属性周围添加引号。", }, { enum: ["consistent"], description: "如果对象中至少有一个属性需要引用,则需要引用所有属性。", }, { enum: ["preserve"], description: "尊重对象属性中引号的输入使用。", }, ], }, rangeEnd: { description: "格式化以给定字符偏移量(不包含)结束的代码。范围将向前扩展到所选语句的末尾。此选项不能与--cursor-offset一起使用。", default: null, type: "integer", }, rangeStart: { description: "从给定字符偏移量开始格式化代码。范围将向后扩展到包含所选语句的第一行的开头。此选项不能与--cursor-offset一起使用。", default: 0, type: "integer", }, requirePragma: { description: "要求在文件的第一个文档块注释中出现'@pretty '或'@format',以便对其进行格式化。", default: false, type: "boolean", }, semi: { description: "添加分号。", default: true, type: "boolean", }, singleAttributePerLine: { description: "在HTML、Vue和JSX中强制每行使用单个属性。", default: false, type: "boolean", }, singleQuote: { description: "用单引号代替双引号。", default: false, type: "boolean", }, tabWidth: { description: "每个缩进级别的空格数。", default: 2, type: "integer", }, trailingComma: { description: "多行时尽可能打印尾随逗号。", default: "es5", oneOf: [ { enum: ["es5"], description: "尾随逗号在ES5中有效(对象、数组等)", }, { enum: ["none"], description: "后面没有逗号。", }, { enum: ["all"], description: "尽可能以逗号结尾(包括函数参数)。", }, ], }, useTabs: { description: "用制表符而不是空格缩进。", default: false, type: "boolean", }, vueIndentScriptAndStyle: { description: "缩进Vue文件中的脚本和样式标记。", default: false, type: "boolean", }, }, }, overridesDefinition: { type: "object", properties: { overrides: { type: "array", description: "提供一个模式列表来覆盖prettier的配置。", items: { type: "object", required: ["files"], properties: { files: { description: "在重写中包含这些文件。", oneOf: [ { type: "string", }, { type: "array", items: { type: "string", }, }, ], }, excludeFiles: { description: "从重写中排除这些文件。", oneOf: [ { type: "string", }, { type: "array", items: { type: "string", }, }, ], }, options: { type: "object", description: "用于应用此覆盖的选项。", $ref: "#/definitions/optionsDefinition", }, }, additionalProperties: false, }, }, }, }, }, id: "https://json.schemastore.org/prettierrc.json", oneOf: [ { type: "object", allOf: [ { $ref: "#/definitions/optionsDefinition", }, { $ref: "#/definitions/overridesDefinition", }, ], }, { type: "string", }, ], title: "Schema for .prettierrc", };
|