Configuration

Reettier reads its settings from a reettier.jsonc config file in your project root. The .jsonc extension means the file supports JSON comments (// and /* */), so each option can carry inline documentation.

Generate a config

Run --init to write a fully commented reettier.jsonc into the current directory, then edit it to suit your project:

reettier --init

File discovery options

These top-level options control which files Reettier finds and indents. They apply whether or not you pass --full:

OptionTypeDefaultDescription
skipDirsstring[]["node_modules", "vendor", "vendors", "dist", "static", "templates"]Directory names to skip when formatting. Any folder matching one of these names is skipped, regardless of where it sits in the project.
skipFilesstring[][]Glob patterns for individual files to skip (e.g. "generator/templates/**/*.ts"). Matched against file paths relative to the project root.
skipExtensionsstring[]["min.js", "min.css"]Compound extensions to always skip, regardless of extensions. A file ending in .min.js or .min.css is skipped even when js/css is in extensions.
extensionsstring[]["ree", "ts", "js", "css"]File extensions to format. Only files with these extensions are picked up during recursive walks or glob matching.
skipDotDirsbooleantrueSkip directories whose name starts with a dot (e.g. .git, .next, .cache, .svelte-kit).
indentstring"\t" (hard tab)The indent string the default indenter writes. Set to e.g. " " for two spaces. This is the only formatting knob for the default indent mode - it preserves your line breaks, so there's nothing else to tune.

There is no config option to turn on full-reprint mode. That's the --full CLI flag only (see Command line) - the config file has no "full": true/false switch.

Reprinter options (--full only)

These options live nested under a "full" key in reettier.jsonc, not at the top level. They're read only when you run reettier --full; the default indenter never looks at them.

OptionTypeDefaultDescription
wrapWidthnumber100Maximum line width before elements are broken onto multiple lines. Controls when inline elements are folded and when long tag lines are split.
collapseSoftWidthnumber100"Soft" wrap width. Any collapsible structure (call args, array/object/type members, imports) whose inline form fits within this width stays on one line regardless of the count caps - short calls with many short args collapse instead of exploding one-per-line. Above this width the count caps apply and wrapWidth is the hard ceiling. Set to 0 to disable.
collapseSingleStatementBlocksbooleantrueWhen enabled, single-statement blocks (if, for, while, etc.) and object-literal function params (fn({ key: val })) collapse onto one line when they fit within wrapWidth.
collapseMaxMembersnumber4Global fallback for the per-category counts below. Any category not explicitly set uses this value. Structures with more items than their limit stay multi-line regardless of wrapWidth.
collapseMaxObjectMembersnumbercollapseMaxMembersMax members an object literal may have and still collapse onto one line.
collapseMaxArrayElementsnumbercollapseMaxMembersMax elements an array may have and still collapse onto one line.
collapseMaxFunctionParamsnumbercollapseMaxMembersMax parameters a function declaration may have and still collapse onto one line.
collapseMaxCallArgsnumbercollapseMaxMembersMax arguments a call may have and still collapse onto one line.
collapseMaxImportsnumbercollapseMaxMembersMax named imports a statement may have and still collapse onto one line.
collapseMaxTypeMembersnumbercollapseMaxMembersMax members a type literal may have and still collapse onto one line.
collapseMaxKeyValuePropsnumber1Max key: value ("named") properties an object literal may have and still collapse onto one line. Shorthand ({ a, b }) and spread ({ ...x }) don't count. With the default 1, { x: 1 } stays inline but { x: 1, y: 2 } expands one-per-line. Set high to disable.
tabWidthnumber4Display width of a tab character for line-width measurement. Reettier indents with hard tabs, so deeply nested lines take up more screen columns than their raw length. This value is used when measuring wrapWidth and collapseSoftWidth - set it to match your editor's tab size.
hugCallArgsbooleanfalseWhen enabled, a single object/array argument that doesn't fit inline keeps its opening ({/([ on the callee line instead of wrapping the whole call.
onelinenumber0Width threshold for collapsing a multi-line HTML element in a .ree file onto a single line when the full <tag>content</tag> fits within it. Only applies to leaf elements (no child tags); elements that don't fit stay multi-line. 0 disables collapsing.

There is no removeUnusedImports option - Reettier's formatting modes never edit code semantics, only layout.

Example

This mirrors what reettier --init writes - note that the reprinter options are nested under "full":

{
    // File discovery (shared by the default indenter and --full). Every key is
    // optional; a missing reettier.jsonc means these defaults apply.
    "skipDirs": ["node_modules", "vendor", "vendors", "dist", "static", "templates"],
    "skipFiles": [],
    "skipExtensions": ["min.js", "min.css"],
    "extensions": ["ree", "ts", "js", "css"],
    "skipDotDirs": true,

    // The only indenter knob: the indent string. "\t" (default) or e.g. "  ".
    "indent": "\t",

    // Reprinter knobs. These apply ONLY when you run `reettier --full`; the
    // default indenter never reads them. Defaults shown; delete any you don't
    // override.
    "full": {
        "wrapWidth": 100,
        "collapseSingleStatementBlocks": true,
        "collapseMaxMembers": 4,
        // "collapseMaxObjectMembers": 4,
        // "collapseMaxArrayElements": 4,
        // "collapseMaxFunctionParams": 4,
        // "collapseMaxCallArgs": 4,
        // "collapseMaxImports": 4,
        // "collapseMaxTypeMembers": 4,
        "collapseSoftWidth": 100,
        "tabWidth": 4,
        "collapseMaxKeyValueProps": 1,
        "hugCallArgs": false,
        "oneline": 0
    }
}