Configuration options for the Oxfmt.
Most options are the same as Prettier's options. See also https://prettier.io/docs/options
In addition, some options are our own extensions.
arrowParens
type: "always" | "avoid" | null
Include parentheses around a sole arrow function parameter. (Default: "always")
bracketSameLine
type: boolean | null
Put the > of a multi-line JSX element at the end of the last line instead of being alone on the next line. (Default: false)
bracketSpacing
type: boolean | null
Print spaces between brackets in object literals. (Default: true)
embeddedLanguageFormatting
type: "auto" | "off" | null
Control whether to format embedded parts in the file. e.g. JS-in-Vue, CSS-in-JS, etc. (Default: "auto")
endOfLine
type: "lf" | "crlf" | "cr" | null
Which end of line characters to apply. (Default: "lf")
experimentalSortImports
type: object | null
Experimental: Sort import statements. (Default: disabled)
experimentalSortImports.groups
type: array | null
Custom groups configuration for organizing imports. Each array element represents a group, and multiple group names in the same array are treated as one. Accepts both string and string[] as group elements.
experimentalSortImports.groups[n]
type: string[]
experimentalSortImports.ignoreCase
type: boolean | null
Ignore case when sorting. (Default: true)
experimentalSortImports.internalPattern
type: string[]
Glob patterns to identify internal imports.
experimentalSortImports.newlinesBetween
type: boolean | null
Add newlines between import groups. (Default: true)
experimentalSortImports.order
type: "asc" | "desc" | null
Sort order. (Default: "asc")
experimentalSortImports.partitionByComment
type: boolean | null
Partition imports by comments. (Default: false)
experimentalSortImports.partitionByNewline
type: boolean | null
Partition imports by newlines. (Default: false)
experimentalSortImports.sortSideEffects
type: boolean | null
Sort side-effect imports. (Default: false)
experimentalSortPackageJson
type: object | boolean | null
Experimental: Sort package.json keys. (Default: true)
experimentalSortPackageJson.sortScripts
type: boolean | null
Sort the scripts field alphabetically. (Default: false)
experimentalTailwindcss
type: object | null
Experimental: Sort Tailwind CSS classes in string literals.
When enabled, Oxfmt sorts Tailwind CSS classes using the same algorithm as prettier-plugin-tailwindcss.
See [TailwindcssConfig] for available options.
(Default: disabled)
experimentalTailwindcss.attributes
type: string[]
List of attributes that contain Tailwind CSS classes.
Note: Regex patterns are not yet supported.
Example: ["myClassProp", ":class"]
Default: ["class", "className"]
experimentalTailwindcss.config
type: string | null
Path to your Tailwind CSS configuration file (v3).
Note: Paths are resolved relative to the Oxfmt configuration file.
Default: "./tailwind.config.js"
experimentalTailwindcss.functions
type: string[]
List of custom function names that contain Tailwind CSS classes.
Note: Regex patterns are not yet supported.
Example: ["clsx", "cn", "cva", "tw"]
Default: []
experimentalTailwindcss.preserveDuplicates
type: boolean | null
Preserve duplicate classes.
Default: false
experimentalTailwindcss.preserveWhitespace
type: boolean | null
Preserve whitespace around classes.
Default: false
experimentalTailwindcss.stylesheet
type: string | null
Path to your Tailwind CSS stylesheet (v4).
Note: Paths are resolved relative to the Oxfmt configuration file.
Example: "./src/app.css"
ignorePatterns
type: string[]
Ignore files matching these glob patterns. Current working directory is used as the root.
insertFinalNewline
type: boolean | null
Whether to insert a final newline at the end of the file. (Default: true)
jsxSingleQuote
type: boolean | null
Use single quotes instead of double quotes in JSX. (Default: false)
objectWrap
type: "preserve" | "collapse" | null
How to wrap object literals when they could fit on one line or span multiple lines. (Default: "preserve")
printWidth
type: integer | null
The line length that the printer will wrap on. (Default: 100)
quoteProps
type: "as-needed" | "consistent" | "preserve" | null
Change when properties in objects are quoted. (Default: "as-needed")
semi
type: boolean | null
Print semicolons at the ends of statements. (Default: true)
singleAttributePerLine
type: boolean | null
Put each attribute on a new line in JSX. (Default: false)
singleQuote
type: boolean | null
Use single quotes instead of double quotes. (Default: false)
tabWidth
type: integer | null
Number of spaces per indentation level. (Default: 2)
trailingComma
type: "all" | "es5" | "none" | null
Print trailing commas wherever possible. (Default: "all")
useTabs
type: boolean | null
Use tabs for indentation or spaces. (Default: false)
