Skip to content

@snailicide/build-config / prettier / prettierConfiguration

prettierConfiguration()

ts
function prettierConfiguration(_options?, _overrides?): {
[key: string]: unknown;
  overrides: PrettierOverrides;
  printWidth?: number;
  tabWidth?: number;
  useTabs?: boolean;
  parentParser?: string;
  __embeddedInHtml?: boolean;
  semi?: boolean;
  singleQuote?: boolean;
  jsxSingleQuote?: boolean;
  trailingComma?: "none" | "es5" | "all";
  bracketSpacing?: boolean;
  objectWrap?: "preserve" | "collapse";
  bracketSameLine?: boolean;
  rangeStart?: number;
  rangeEnd?: number;
  parser?: LiteralUnion<BuiltInParserName, string>;
  filepath?: string;
  requirePragma?: boolean;
  insertPragma?: boolean;
  checkIgnorePragma?: boolean;
  proseWrap?: "always" | "never" | "preserve";
  arrowParens?: "always" | "avoid";
  plugins?: (string | URL | Plugin<any>)[];
  htmlWhitespaceSensitivity?: "css" | "strict" | "ignore";
  endOfLine?: "auto" | "lf" | "crlf" | "cr";
  quoteProps?: "preserve" | "consistent" | "as-needed";
  vueIndentScriptAndStyle?: boolean;
  embeddedLanguageFormatting?: "off" | "auto";
  singleAttributePerLine?: boolean;
  experimentalOperatorPosition?: "start" | "end";
  experimentalTernaries?: boolean;
  jsxBracketSameLine?: boolean;
  jsdocSpaces?: number;
  jsdocPrintWidth?: number;
  jsdocDescriptionWithDot?: boolean;
  jsdocDescriptionTag?: boolean;
  jsdocVerticalAlignment?: boolean;
  jsdocKeepUnParseAbleExampleIndent?: boolean;
  jsdocSingleLineComment?: boolean;
  jsdocCommentLineStrategy?: "singleLine" | "multiline" | "keep";
  jsdocSeparateReturnsFromParam?: boolean;
  jsdocSeparateTagGroups?: boolean;
  jsdocAddDefaultToDescription?: boolean;
  jsdocCapitalizeDescription?: boolean;
  jsdocPreferCodeFences?: boolean;
  tsdoc?: boolean;
  jsdocLineWrappingStyle?: "greedy";
  jsdocTagsOrder?: Record<string, number>;
};

Defined in: packages/build-config/src/prettier/index.ts:96

Parameters

ParameterType
_options?PrettierOptions
_overrides?PrettierOverrides

Returns

NameTypeDescriptionDefined in
overridesPrettierOverrides-packages/build-config/src/prettier/index.ts:26
printWidth?numberSpecify the line length that the printer will wrap on. Default 80node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/doc.d.ts:214
tabWidth?numberSpecify the number of spaces per indentation-level. Default 2node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/doc.d.ts:219
useTabs?booleanIndent lines with tabs instead of spaces Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/doc.d.ts:224
parentParser?string-node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/doc.d.ts:225
__embeddedInHtml?boolean-node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/doc.d.ts:226
semi?booleanPrint semicolons at the ends of statements. Default truenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:324
singleQuote?booleanUse single quotes instead of double quotes. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:329
jsxSingleQuote?booleanUse single quotes in JSX. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:334
trailingComma?"none" | "es5" | "all"Print trailing commas wherever possible. Default "all"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:339
bracketSpacing?booleanPrint spaces between brackets in object literals. Default truenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:344
objectWrap?"preserve" | "collapse"How to wrap object literals. Default "preserve"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:349
bracketSameLine?booleanPut the > of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being alone on the next line (does not apply to self closing elements). Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:355
rangeStart?numberFormat only a segment of a file. Default 0node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:360
rangeEnd?numberFormat only a segment of a file. Default Number.POSITIVE_INFINITYnode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:365
parser?LiteralUnion<BuiltInParserName, string>Specify which parser to use.node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:369
filepath?stringSpecify the input filepath. This will be used to do parser inference.node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:373
requirePragma?booleanPrettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. This is very useful when gradually transitioning large, unformatted codebases to prettier. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:379
insertPragma?booleanPrettier can insert a special Format marker at the top of files specifying that the file has been formatted with prettier. This works well when used in tandem with the --require-pragma option. If there is already a docblock at the top of the file then this option will add a newline to it with the Format marker. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:387
checkIgnorePragma?booleanPrettier can allow individual files to opt out of formatting if they contain a special comment, called a pragma, at the top of the file. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:392
proseWrap?"always" | "never" | "preserve"By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer. In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out. Default "preserve"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:398
arrowParens?"always" | "avoid"Include parentheses around a sole arrow function parameter. Default "always"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:403
plugins?(string | URL | Plugin<any>)[]Provide ability to support new languages to prettier.node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:407
htmlWhitespaceSensitivity?"css" | "strict" | "ignore"How to handle whitespaces in HTML. Default "css"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:412
endOfLine?"auto" | "lf" | "crlf" | "cr"Which end of line characters to apply. Default "lf"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:417
quoteProps?"preserve" | "consistent" | "as-needed"Change when properties in objects are quoted. Default "as-needed"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:422
vueIndentScriptAndStyle?booleanWhether or not to indent the code inside <script> and <style> tags in Vue files. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:427
embeddedLanguageFormatting?"off" | "auto"Control whether Prettier formats quoted code embedded in the file. Default "auto"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:432
singleAttributePerLine?booleanEnforce single attribute per line in HTML, Vue and JSX. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:437
experimentalOperatorPosition?"start" | "end"Where to print operators when binary expressions wrap lines. Default "end"node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:442
experimentalTernaries?booleanUse curious ternaries, with the question mark after the condition, instead of on the same line as the consequent. Default falsenode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:448
jsxBracketSameLine?booleanPut the > of a multi-line JSX element at the end of the last line instead of being alone on the next line. Default false Deprecated use bracketSameLine insteadnode_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.d.ts:454
jsdocSpaces?number-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:3
jsdocPrintWidth?number-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:4
jsdocDescriptionWithDot?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:5
jsdocDescriptionTag?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:6
jsdocVerticalAlignment?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:7
jsdocKeepUnParseAbleExampleIndent?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:8
jsdocSingleLineComment?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:9
jsdocCommentLineStrategy?"singleLine" | "multiline" | "keep"-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:10
jsdocSeparateReturnsFromParam?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:11
jsdocSeparateTagGroups?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:12
jsdocAddDefaultToDescription?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:13
jsdocCapitalizeDescription?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:14
jsdocPreferCodeFences?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:15
tsdoc?boolean-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:16
jsdocLineWrappingStyle?"greedy"-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:17
jsdocTagsOrder?Record<string, number>-node_modules/.pnpm/prettier-plugin-jsdoc@1.3.3_prettier@3.6.2/node_modules/prettier-plugin-jsdoc/dist/types.d.ts:18