package prettier // Schema for .prettierrc #Schema: { @jsonschema(schema="http://json-schema.org/draft-07/schema#") @jsonschema(id="https://json.schemastore.org/prettierrc.json") matchN(1, [matchN(2, [#optionsDefinition & { ... }, #overridesDefinition & { ... }]), string]) #optionsDefinition: { // Include parentheses around a sole arrow function parameter. "arrowParens"?: matchN(1, ["always", "avoid"]) // Put > of opening tags on the last line instead of on a new // line. "bracketSameLine"?: bool // Print spaces between brackets. "bracketSpacing"?: bool // Check whether the file's first docblock comment contains // '@noprettier' or '@noformat' to determine if it should be // formatted. "checkIgnorePragma"?: bool // Print (to stderr) where a cursor at the given position would // move to after formatting. "cursorOffset"?: int // Control how Prettier formats quoted code embedded in the file. "embeddedLanguageFormatting"?: matchN(1, ["auto", "off"]) // Which end of line characters to apply. "endOfLine"?: matchN(1, ["lf", "crlf", "cr", "auto"]) // Where to print operators when binary expressions wrap lines. "experimentalOperatorPosition"?: matchN(1, ["start", "end"]) // Use curious ternaries, with the question mark after the // condition. "experimentalTernaries"?: bool // Specify the input filepath. This will be used to do parser // inference. "filepath"?: string // How to handle whitespaces in HTML. "htmlWhitespaceSensitivity"?: matchN(1, ["css", "strict", "ignore"]) // Insert @format pragma into file's first docblock comment. "insertPragma"?: bool // Use single quotes in JSX. "jsxSingleQuote"?: bool // How to wrap object literals. "objectWrap"?: matchN(1, ["preserve", "collapse"]) // Which parser to use. "parser"?: matchN(>=1, ["flow", "babel", "babel-flow", "babel-ts", "typescript", "acorn", "espree", "meriyah", "css", "less", "scss", "json", "json5", "jsonc", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "glimmer", "html", "angular", "lwc", "mjml", string]) // Add a plugin. Multiple plugins can be passed as separate // `--plugin`s. "plugins"?: [...string] // The line length where Prettier will try wrap. "printWidth"?: int // How to wrap prose. "proseWrap"?: matchN(1, ["always", "never", "preserve"]) // Change when properties in objects are quoted. "quoteProps"?: matchN(1, ["as-needed", "consistent", "preserve"]) // Format code ending at a given character offset (exclusive). // The range will extend forwards to the end of the selected // statement. "rangeEnd"?: int // Format code starting at a given character offset. // The range will extend backwards to the start of the first line // containing the selected statement. "rangeStart"?: int // Require either '@prettier' or '@format' to be present in the // file's first docblock comment in order for it to be formatted. "requirePragma"?: bool // Print semicolons. "semi"?: bool // Enforce single attribute per line in HTML, Vue and JSX. "singleAttributePerLine"?: bool // Use single quotes instead of double quotes. "singleQuote"?: bool // Number of spaces per indentation level. "tabWidth"?: int // Print trailing commas wherever possible when multi-line. "trailingComma"?: matchN(1, ["all", "es5", "none"]) // Indent with tabs instead of spaces. "useTabs"?: bool // Indent script and style tags in Vue files. "vueIndentScriptAndStyle"?: bool ... } #overridesDefinition: { // Provide a list of patterns to override prettier configuration. "overrides"?: [...close({ // Include these files in this override. "files"!: matchN(1, [string, [...string]]) // Exclude these files from this override. "excludeFiles"?: matchN(1, [string, [...string]]) "options"?: #optionsDefinition })] ... } }