Configuration options for the Oxfmt. โ
Most options are the same as Prettier's options, but not all of them. In addition, some options are our own extensions.
arrowParens โ
type: "always" | "avoid"
Include parentheses around a sole arrow function parameter.
- Default:
"always"
bracketSameLine โ
type: boolean
Put 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:
false
bracketSpacing โ
type: boolean
Print spaces between brackets in object literals.
- Default:
true
embeddedLanguageFormatting โ
type: "auto" | "off"
Control whether to format embedded parts (For example, CSS-in-JS, or JS-in-Vue, etc.) in the file.
NOTE: XXX-in-JS support is incomplete.
- Default:
"auto"
endOfLine โ
type: "lf" | "crlf" | "cr"
Which end of line characters to apply.
NOTE: "auto" is not supported.
- Default:
"lf" - Overrides
.editorconfig.end_of_line
htmlWhitespaceSensitivity โ
type: "css" | "strict" | "ignore"
Specify the global whitespace sensitivity for HTML, Vue, Angular, and Handlebars.
- Default:
"css"
ignorePatterns โ
type: string[]
Ignore files matching these glob patterns. Patterns are based on the location of the Oxfmt configuration file.
- Default:
[]
insertFinalNewline โ
type: boolean
Whether to insert a final newline at the end of the file.
- Default:
true - Overrides
.editorconfig.insert_final_newline
jsdoc โ
type: object | boolean
Enable JSDoc comment formatting.
When enabled, JSDoc comments are normalized and reformatted: tag aliases are canonicalized, descriptions are capitalized, long lines are wrapped, and short comments are collapsed to single-line.
Pass true or an object to enable with defaults, or omit/set false to disable.
- Default: Disabled
jsdoc.addDefaultToDescription โ
type: boolean
Append default values to @param descriptions (e.g. "Default is value").
- Default:
true
jsdoc.bracketSpacing โ
type: boolean
Add spaces inside JSDoc type braces: {string} โ { string }.
- Default:
false
jsdoc.capitalizeDescriptions โ
type: boolean
Capitalize the first letter of tag descriptions.
- Default:
true
jsdoc.commentLineStrategy โ
type: string
How to format comment blocks.
"singleLine"โ Convert to single-line/** content */when possible."multiline"โ Always use multi-line format."keep"โ Preserve original formatting.Default:
"singleLine"
jsdoc.descriptionTag โ
type: boolean
Emit @description tag instead of inline description.
- Default:
false
jsdoc.descriptionWithDot โ
type: boolean
Add a trailing dot to the end of descriptions.
- Default:
false
jsdoc.keepUnparsableExampleIndent โ
type: boolean
Preserve indentation in unparsable @example code.
- Default:
false
jsdoc.lineWrappingStyle โ
type: string
Strategy for wrapping description lines at print width.
"greedy"โ Always re-wrap text to fit within print width."balance"โ Preserve original line breaks if all lines fit within print width.Default:
"greedy"
jsdoc.preferCodeFences โ
type: boolean
Use fenced code blocks (```) instead of 4-space indentation for code without a language tag.
- Default:
false
jsdoc.separateReturnsFromParam โ
type: boolean
Add a blank line between the last @param and @returns.
- Default:
false
jsdoc.separateTagGroups โ
type: boolean
Add blank lines between different tag groups (e.g. between @param and @returns).
- Default:
false
jsxSingleQuote โ
type: boolean
Use single quotes instead of double quotes in JSX.
- Default:
false
objectWrap โ
type: "preserve" | "collapse"
How to wrap object literals when they could fit on one line or span multiple lines.
By default, formats objects as multi-line if there is a newline prior to the first property. Authors can use this heuristic to contextually improve readability, though it has some downsides.
- Default:
"preserve"
overrides โ
type: array
File-specific overrides. When a file matches multiple overrides, the later override takes precedence (array order matters).
- Default:
[]
overrides[n] โ
type: object
overrides[n].excludeFiles โ
type: string[]
Glob patterns to exclude from this override.
overrides[n].files โ
type: string[]
Glob patterns to match files for this override. All patterns are relative to the Oxfmt configuration file.
overrides[n].options โ
type: object
overrides[n].options.arrowParens โ
type: "always" | "avoid"
Include parentheses around a sole arrow function parameter.
- Default:
"always"
overrides[n].options.bracketSameLine โ
type: boolean
Put 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:
false
overrides[n].options.bracketSpacing โ
type: boolean
Print spaces between brackets in object literals.
- Default:
true
overrides[n].options.embeddedLanguageFormatting โ
type: "auto" | "off"
Control whether to format embedded parts (For example, CSS-in-JS, or JS-in-Vue, etc.) in the file.
NOTE: XXX-in-JS support is incomplete.
- Default:
"auto"
overrides[n].options.endOfLine โ
type: "lf" | "crlf" | "cr"
Which end of line characters to apply.
NOTE: "auto" is not supported.
- Default:
"lf" - Overrides
.editorconfig.end_of_line
overrides[n].options.htmlWhitespaceSensitivity โ
type: "css" | "strict" | "ignore"
Specify the global whitespace sensitivity for HTML, Vue, Angular, and Handlebars.
- Default:
"css"
overrides[n].options.insertFinalNewline โ
type: boolean
Whether to insert a final newline at the end of the file.
- Default:
true - Overrides
.editorconfig.insert_final_newline
overrides[n].options.jsdoc โ
type: object | boolean
Enable JSDoc comment formatting.
When enabled, JSDoc comments are normalized and reformatted: tag aliases are canonicalized, descriptions are capitalized, long lines are wrapped, and short comments are collapsed to single-line.
Pass true or an object to enable with defaults, or omit/set false to disable.
- Default: Disabled
overrides[n].options.jsdoc.addDefaultToDescription โ
type: boolean
Append default values to @param descriptions (e.g. "Default is value").
- Default:
true
overrides[n].options.jsdoc.bracketSpacing โ
type: boolean
Add spaces inside JSDoc type braces: {string} โ { string }.
- Default:
false
overrides[n].options.jsdoc.capitalizeDescriptions โ
type: boolean
Capitalize the first letter of tag descriptions.
- Default:
true
overrides[n].options.jsdoc.commentLineStrategy โ
type: string
How to format comment blocks.
"singleLine"โ Convert to single-line/** content */when possible."multiline"โ Always use multi-line format."keep"โ Preserve original formatting.Default:
"singleLine"
overrides[n].options.jsdoc.descriptionTag โ
type: boolean
Emit @description tag instead of inline description.
- Default:
false
overrides[n].options.jsdoc.descriptionWithDot โ
type: boolean
Add a trailing dot to the end of descriptions.
- Default:
false
overrides[n].options.jsdoc.keepUnparsableExampleIndent โ
type: boolean
Preserve indentation in unparsable @example code.
- Default:
false
overrides[n].options.jsdoc.lineWrappingStyle โ
type: string
Strategy for wrapping description lines at print width.
"greedy"โ Always re-wrap text to fit within print width."balance"โ Preserve original line breaks if all lines fit within print width.Default:
"greedy"
overrides[n].options.jsdoc.preferCodeFences โ
type: boolean
Use fenced code blocks (```) instead of 4-space indentation for code without a language tag.
- Default:
false
overrides[n].options.jsdoc.separateReturnsFromParam โ
type: boolean
Add a blank line between the last @param and @returns.
- Default:
false
overrides[n].options.jsdoc.separateTagGroups โ
type: boolean
Add blank lines between different tag groups (e.g. between @param and @returns).
- Default:
false
overrides[n].options.jsxSingleQuote โ
type: boolean
Use single quotes instead of double quotes in JSX.
- Default:
false
overrides[n].options.objectWrap โ
type: "preserve" | "collapse"
How to wrap object literals when they could fit on one line or span multiple lines.
By default, formats objects as multi-line if there is a newline prior to the first property. Authors can use this heuristic to contextually improve readability, though it has some downsides.
- Default:
"preserve"
overrides[n].options.printWidth โ
type: integer
Specify the line length that the printer will wrap on.
If you don't want line wrapping when formatting Markdown, you can set the proseWrap option to disable it.
- Default:
100 - Overrides
.editorconfig.max_line_length
overrides[n].options.proseWrap โ
type: "always" | "never" | "preserve"
How to wrap prose.
By default, formatter will not change wrapping in markdown text since some services use a linebreak-sensitive renderer, e.g. GitHub comments and BitBucket. To wrap prose to the print width, change this option to "always". If you want to force all prose blocks to be on a single line and rely on editor/viewer soft wrapping instead, you can use "never".
- Default:
"preserve"
overrides[n].options.quoteProps โ
type: "as-needed" | "consistent" | "preserve"
Change when properties in objects are quoted.
- Default:
"as-needed"
overrides[n].options.semi โ
type: boolean
Print semicolons at the ends of statements.
- Default:
true
overrides[n].options.singleAttributePerLine โ
type: boolean
Enforce single attribute per line in HTML, Vue, and JSX.
- Default:
false
overrides[n].options.singleQuote โ
type: boolean
Use single quotes instead of double quotes.
For JSX, you can set the jsxSingleQuote option.
- Default:
false - Overrides
.editorconfig.quote_type
overrides[n].options.sortImports โ
type: object | boolean
Sort import statements.
Using the similar algorithm as eslint-plugin-perfectionist/sort-imports. For details, see each field's documentation.
Pass true or an object to enable with defaults, or omit/set false to disable.
- Default: Disabled
overrides[n].options.sortImports.customGroups โ
type: array
Define your own groups for matching very specific imports.
The customGroups list is ordered: The first definition that matches an element will be used. Custom groups have a higher priority than any predefined group.
If you want a predefined group to take precedence over a custom group, you must write a custom group definition that does the same as what the predefined group does, and put it first in the list.
If you specify multiple conditions like elementNamePattern, selector, and modifiers, all conditions must be met for an import to match the custom group (AND logic).
- Default:
[]
####### overrides[n].options.sortImports.customGroups[n]
type: object
######## overrides[n].options.sortImports.customGroups[n].elementNamePattern
type: string[]
default: []
List of glob patterns to match import sources for this group.
######## overrides[n].options.sortImports.customGroups[n].groupName
type: string
default: ""
Name of the custom group, used in the groups option.
######## overrides[n].options.sortImports.customGroups[n].modifiers
type: string[]
Modifiers to match the import characteristics. All specified modifiers must be present (AND logic).
Possible values: "side_effect", "type", "value", "default", "wildcard", "named"
######## overrides[n].options.sortImports.customGroups[n].selector
type: string
Selector to match the import kind.
Possible values: "type", "side_effect_style", "side_effect", "style", "index", "sibling", "parent", "subpath", "internal", "builtin", "external", "import"
overrides[n].options.sortImports.groups โ
type: array
Specifies a list of predefined import groups for sorting.
Each import will be assigned a single group specified in the groups option (or the unknown group if no match is found). The order of items in the groups option determines how groups are ordered.
Within a given group, members will be sorted according to the type, order, ignoreCase, etc. options.
Individual groups can be combined together by placing them in an array. The order of groups in that array does not matter. All members of the groups in the array will be sorted together as if they were part of a single group.
Predefined groups are characterized by a single selector and potentially multiple modifiers. You may enter modifiers in any order, but the selector must always come at the end.
The list of selectors is sorted from most to least important:
typeโ TypeScript type imports.side_effect_styleโ Side effect style imports.side_effectโ Side effect imports.styleโ Style imports.indexโ Main file from the current directory.siblingโ Modules from the same directory.parentโ Modules from the parent directory.subpathโ Node.js subpath imports.internalโ Your internal modules.builtinโ Node.js Built-in Modules.externalโ External modules installed in the project.importโ Any import.
The list of modifiers is sorted from most to least important:
side_effectโ Side effect imports.typeโ TypeScript type imports.valueโ Value imports.defaultโ Imports containing the default specifier.wildcardโ Imports containing the wildcard (* as) specifier.namedโ Imports containing at least one named specifier.Default: See below
["builtin", "external", ["internal", "subpath"], ["parent", "sibling", "index"], "style", "unknown"]Also, you can override the global newlinesBetween setting for specific group boundaries by including a { "newlinesBetween": boolean } marker object in the groups list at the desired position.
####### overrides[n].options.sortImports.groups[n]
type: object | array | string
######## overrides[n].options.sortImports.groups[n].newlinesBetween
type: boolean
overrides[n].options.sortImports.ignoreCase โ
type: boolean
Specifies whether sorting should be case-sensitive.
- Default:
true
overrides[n].options.sortImports.internalPattern โ
type: string[]
Specifies a prefix for identifying internal imports.
This is useful for distinguishing your own modules from external dependencies.
- Default:
["~/", "@/"]
overrides[n].options.sortImports.newlinesBetween โ
type: boolean
Specifies whether to add newlines between groups.
When false, no newlines are added between groups.
- Default:
true
overrides[n].options.sortImports.order โ
type: "asc" | "desc"
Specifies whether to sort items in ascending or descending order.
- Default:
"asc"
overrides[n].options.sortImports.partitionByComment โ
type: boolean
Enables the use of comments to separate imports into logical groups.
When true, all comments will be treated as delimiters, creating partitions.
import { b1, b2 } from "b";
// PARTITION
import { a } from "a";
import { c } from "c";- Default:
false
overrides[n].options.sortImports.partitionByNewline โ
type: boolean
Enables the empty line to separate imports into logical groups.
When true, formatter will not sort imports if there is an empty line between them. This helps maintain the defined order of logically separated groups of members.
import { b1, b2 } from "b";
import { a } from "a";
import { c } from "c";- Default:
false
overrides[n].options.sortImports.sortSideEffects โ
type: boolean
Specifies whether side effect imports should be sorted.
By default, sorting side-effect imports is disabled for security reasons.
- Default:
false
overrides[n].options.sortPackageJson โ
type: object | boolean
Sort package.json keys.
The algorithm is NOT compatible with prettier-plugin-sort-packagejson. But we believe it is clearer and easier to navigate. For details, see each field's documentation.
- Default:
true
overrides[n].options.sortPackageJson.sortScripts โ
type: boolean
Sort the scripts field alphabetically.
- Default:
false
overrides[n].options.sortTailwindcss โ
type: object | boolean
Sort Tailwind CSS classes.
Using the same algorithm as prettier-plugin-tailwindcss. Option names omit the tailwind prefix used in the original plugin (e.g., config instead of tailwindConfig). For details, see each field's documentation.
Pass true or an object to enable with defaults, or omit/set false to disable.
- Default: Disabled
overrides[n].options.sortTailwindcss.attributes โ
type: string[]
List of additional attributes to sort beyond class and className (exact match).
NOTE: Regex patterns are not yet supported.
- Default:
[] - Example:
["myClassProp", ":class"]
overrides[n].options.sortTailwindcss.config โ
type: string
Path to your Tailwind CSS configuration file (v3).
NOTE: Paths are resolved relative to the Oxfmt configuration file.
- Default: Automatically find
"tailwind.config.js"
overrides[n].options.sortTailwindcss.functions โ
type: string[]
List of custom function names whose arguments should be sorted (exact match).
NOTE: Regex patterns are not yet supported.
- Default:
[] - Example:
["clsx", "cn", "cva", "tw"]
overrides[n].options.sortTailwindcss.preserveDuplicates โ
type: boolean
Preserve duplicate classes.
- Default:
false
overrides[n].options.sortTailwindcss.preserveWhitespace โ
type: boolean
Preserve whitespace around classes.
- Default:
false
overrides[n].options.sortTailwindcss.stylesheet โ
type: string
Path to your Tailwind CSS stylesheet (v4).
NOTE: Paths are resolved relative to the Oxfmt configuration file.
- Default: Installed Tailwind CSS's
theme.css
overrides[n].options.tabWidth โ
type: integer
Specify the number of spaces per indentation-level.
- Default:
2 - Overrides
.editorconfig.indent_size(falls back to.editorconfig.tab_width)
overrides[n].options.trailingComma โ
type: "all" | "es5" | "none"
Print trailing commas wherever possible in multi-line comma-separated syntactic structures.
A single-line array, for example, never gets trailing commas.
- Default:
"all"
overrides[n].options.useTabs โ
type: boolean
Indent lines with tabs instead of spaces.
- Default:
false - Overrides
.editorconfig.indent_style
overrides[n].options.vueIndentScriptAndStyle โ
type: boolean
Whether or not to indent the code inside <script> and <style> tags in Vue files.
- Default:
false
printWidth โ
type: integer
Specify the line length that the printer will wrap on.
If you don't want line wrapping when formatting Markdown, you can set the proseWrap option to disable it.
- Default:
100 - Overrides
.editorconfig.max_line_length
proseWrap โ
type: "always" | "never" | "preserve"
How to wrap prose.
By default, formatter will not change wrapping in markdown text since some services use a linebreak-sensitive renderer, e.g. GitHub comments and BitBucket. To wrap prose to the print width, change this option to "always". If you want to force all prose blocks to be on a single line and rely on editor/viewer soft wrapping instead, you can use "never".
- Default:
"preserve"
quoteProps โ
type: "as-needed" | "consistent" | "preserve"
Change when properties in objects are quoted.
- Default:
"as-needed"
semi โ
type: boolean
Print semicolons at the ends of statements.
- Default:
true
singleAttributePerLine โ
type: boolean
Enforce single attribute per line in HTML, Vue, and JSX.
- Default:
false
singleQuote โ
type: boolean
Use single quotes instead of double quotes.
For JSX, you can set the jsxSingleQuote option.
- Default:
false - Overrides
.editorconfig.quote_type
sortImports โ
type: object | boolean
Sort import statements.
Using the similar algorithm as eslint-plugin-perfectionist/sort-imports. For details, see each field's documentation.
Pass true or an object to enable with defaults, or omit/set false to disable.
- Default: Disabled
sortImports.customGroups โ
type: array
Define your own groups for matching very specific imports.
The customGroups list is ordered: The first definition that matches an element will be used. Custom groups have a higher priority than any predefined group.
If you want a predefined group to take precedence over a custom group, you must write a custom group definition that does the same as what the predefined group does, and put it first in the list.
If you specify multiple conditions like elementNamePattern, selector, and modifiers, all conditions must be met for an import to match the custom group (AND logic).
- Default:
[]
sortImports.customGroups[n] โ
type: object
sortImports.customGroups[n].elementNamePattern โ
type: string[]
default: []
List of glob patterns to match import sources for this group.
sortImports.customGroups[n].groupName โ
type: string
default: ""
Name of the custom group, used in the groups option.
sortImports.customGroups[n].modifiers โ
type: string[]
Modifiers to match the import characteristics. All specified modifiers must be present (AND logic).
Possible values: "side_effect", "type", "value", "default", "wildcard", "named"
sortImports.customGroups[n].selector โ
type: string
Selector to match the import kind.
Possible values: "type", "side_effect_style", "side_effect", "style", "index", "sibling", "parent", "subpath", "internal", "builtin", "external", "import"
sortImports.groups โ
type: array
Specifies a list of predefined import groups for sorting.
Each import will be assigned a single group specified in the groups option (or the unknown group if no match is found). The order of items in the groups option determines how groups are ordered.
Within a given group, members will be sorted according to the type, order, ignoreCase, etc. options.
Individual groups can be combined together by placing them in an array. The order of groups in that array does not matter. All members of the groups in the array will be sorted together as if they were part of a single group.
Predefined groups are characterized by a single selector and potentially multiple modifiers. You may enter modifiers in any order, but the selector must always come at the end.
The list of selectors is sorted from most to least important:
typeโ TypeScript type imports.side_effect_styleโ Side effect style imports.side_effectโ Side effect imports.styleโ Style imports.indexโ Main file from the current directory.siblingโ Modules from the same directory.parentโ Modules from the parent directory.subpathโ Node.js subpath imports.internalโ Your internal modules.builtinโ Node.js Built-in Modules.externalโ External modules installed in the project.importโ Any import.
The list of modifiers is sorted from most to least important:
side_effectโ Side effect imports.typeโ TypeScript type imports.valueโ Value imports.defaultโ Imports containing the default specifier.wildcardโ Imports containing the wildcard (* as) specifier.namedโ Imports containing at least one named specifier.Default: See below
["builtin", "external", ["internal", "subpath"], ["parent", "sibling", "index"], "style", "unknown"]Also, you can override the global newlinesBetween setting for specific group boundaries by including a { "newlinesBetween": boolean } marker object in the groups list at the desired position.
sortImports.groups[n] โ
type: object | array | string
sortImports.groups[n].newlinesBetween โ
type: boolean
sortImports.ignoreCase โ
type: boolean
Specifies whether sorting should be case-sensitive.
- Default:
true
sortImports.internalPattern โ
type: string[]
Specifies a prefix for identifying internal imports.
This is useful for distinguishing your own modules from external dependencies.
- Default:
["~/", "@/"]
sortImports.newlinesBetween โ
type: boolean
Specifies whether to add newlines between groups.
When false, no newlines are added between groups.
- Default:
true
sortImports.order โ
type: "asc" | "desc"
Specifies whether to sort items in ascending or descending order.
- Default:
"asc"
sortImports.partitionByComment โ
type: boolean
Enables the use of comments to separate imports into logical groups.
When true, all comments will be treated as delimiters, creating partitions.
import { b1, b2 } from "b";
// PARTITION
import { a } from "a";
import { c } from "c";- Default:
false
sortImports.partitionByNewline โ
type: boolean
Enables the empty line to separate imports into logical groups.
When true, formatter will not sort imports if there is an empty line between them. This helps maintain the defined order of logically separated groups of members.
import { b1, b2 } from "b";
import { a } from "a";
import { c } from "c";- Default:
false
sortImports.sortSideEffects โ
type: boolean
Specifies whether side effect imports should be sorted.
By default, sorting side-effect imports is disabled for security reasons.
- Default:
false
sortPackageJson โ
type: object | boolean
Sort package.json keys.
The algorithm is NOT compatible with prettier-plugin-sort-packagejson. But we believe it is clearer and easier to navigate. For details, see each field's documentation.
- Default:
true
sortPackageJson.sortScripts โ
type: boolean
Sort the scripts field alphabetically.
- Default:
false
sortTailwindcss โ
type: object | boolean
Sort Tailwind CSS classes.
Using the same algorithm as prettier-plugin-tailwindcss. Option names omit the tailwind prefix used in the original plugin (e.g., config instead of tailwindConfig). For details, see each field's documentation.
Pass true or an object to enable with defaults, or omit/set false to disable.
- Default: Disabled
sortTailwindcss.attributes โ
type: string[]
List of additional attributes to sort beyond class and className (exact match).
NOTE: Regex patterns are not yet supported.
- Default:
[] - Example:
["myClassProp", ":class"]
sortTailwindcss.config โ
type: string
Path to your Tailwind CSS configuration file (v3).
NOTE: Paths are resolved relative to the Oxfmt configuration file.
- Default: Automatically find
"tailwind.config.js"
sortTailwindcss.functions โ
type: string[]
List of custom function names whose arguments should be sorted (exact match).
NOTE: Regex patterns are not yet supported.
- Default:
[] - Example:
["clsx", "cn", "cva", "tw"]
sortTailwindcss.preserveDuplicates โ
type: boolean
Preserve duplicate classes.
- Default:
false
sortTailwindcss.preserveWhitespace โ
type: boolean
Preserve whitespace around classes.
- Default:
false
sortTailwindcss.stylesheet โ
type: string
Path to your Tailwind CSS stylesheet (v4).
NOTE: Paths are resolved relative to the Oxfmt configuration file.
- Default: Installed Tailwind CSS's
theme.css
tabWidth โ
type: integer
Specify the number of spaces per indentation-level.
- Default:
2 - Overrides
.editorconfig.indent_size(falls back to.editorconfig.tab_width)
trailingComma โ
type: "all" | "es5" | "none"
Print trailing commas wherever possible in multi-line comma-separated syntactic structures.
A single-line array, for example, never gets trailing commas.
- Default:
"all"
useTabs โ
type: boolean
Indent lines with tabs instead of spaces.
- Default:
false - Overrides
.editorconfig.indent_style
vueIndentScriptAndStyle โ
type: boolean
Whether or not to indent the code inside <script> and <style> tags in Vue files.
- Default:
false
