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:
| Option | Type | Default | Description |
|---|---|---|---|
skipDirs | string[] | ["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. |
skipFiles | string[] | [] | Glob patterns for individual files to skip (e.g. "generator/templates/**/*.ts"). Matched against file paths relative to the project root. |
skipExtensions | string[] | ["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. |
extensions | string[] | ["ree", "ts", "js", "css"] | File extensions to format. Only files with these extensions are picked up during recursive walks or glob matching. |
skipDotDirs | boolean | true | Skip directories whose name starts with a dot (e.g. .git, .next, .cache, .svelte-kit). |
indent | string | "\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.
| Option | Type | Default | Description |
|---|---|---|---|
wrapWidth | number | 100 | Maximum line width before elements are broken onto multiple lines. Controls when inline elements are folded and when long tag lines are split. |
collapseSoftWidth | number | 100 | "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. |
collapseSingleStatementBlocks | boolean | true | When 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. |
collapseMaxMembers | number | 4 | Global 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. |
collapseMaxObjectMembers | number | collapseMaxMembers | Max members an object literal may have and still collapse onto one line. |
collapseMaxArrayElements | number | collapseMaxMembers | Max elements an array may have and still collapse onto one line. |
collapseMaxFunctionParams | number | collapseMaxMembers | Max parameters a function declaration may have and still collapse onto one line. |
collapseMaxCallArgs | number | collapseMaxMembers | Max arguments a call may have and still collapse onto one line. |
collapseMaxImports | number | collapseMaxMembers | Max named imports a statement may have and still collapse onto one line. |
collapseMaxTypeMembers | number | collapseMaxMembers | Max members a type literal may have and still collapse onto one line. |
collapseMaxKeyValueProps | number | 1 | Max 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. |
tabWidth | number | 4 | Display 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. |
hugCallArgs | boolean | false | When enabled, a single object/array argument that doesn't fit inline keeps its opening ({/([ on the callee line instead of wrapping the whole call. |
oneline | number | 0 | Width 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
}
}