Skip to content

Commit 632ae72

Browse files
committed
Config file - docs
1 parent 1811e7b commit 632ae72

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

docs/configuration/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@
88

99
Fresh uses layered configuration.
1010

11+
## Config File Format
12+
13+
Config files are **JSONC** — standard JSON plus two conveniences:
14+
15+
- **Comments**`// line` and `/* block */`
16+
- **Trailing commas** — a comma after the last entry in an object or array is fine
17+
18+
```jsonc
19+
{
20+
"theme": "builtin://dracula",
21+
"editor": {
22+
// tweak as needed
23+
"tab_size": 2,
24+
"line_wrap": true, // trailing comma below is OK
25+
},
26+
}
27+
```
28+
29+
The parser is also lenient about small slips — a missing comma between entries
30+
or an unquoted key is tolerated — so a stray mistake won't silently reset you to
31+
defaults. Don't rely on that as a style; keep your config valid JSONC. An empty
32+
or comment-only file is treated as "no overrides".
33+
34+
A genuinely broken file (e.g. an unterminated object) does fail to parse. On
35+
**save**, Fresh refuses to overwrite an unparseable file and surfaces the error
36+
rather than clobbering your settings.
37+
1138
## Configuration Layers
1239

1340
Settings are loaded from multiple layers, with higher layers overriding lower ones:

0 commit comments

Comments
 (0)