Command Palette

Search for a command to run...

atypical
Configuration

Merging

How a file combines with the files it extends.

ValueMerge
TableKey by key
Array whose every entry has a nameEntry by entry, matched on name
Any other value, unnamed arrays includedReplaces the value beneath

Named arrays

The examples below extend this base:

base.toml
[[commit.slots]]
name = "keywords"
kind = "word"

[[commit.slots]]
name = "separator"
kind = "symbol"

Matched entries

A matched entry merges field by field. Unwritten fields keep the base's values.

extends = "base.toml"

[[commit.slots]]
name = "keywords"
required = true

Result: keywords has kind = "word" and required = true.

Unmatched entries

An unmatched entry is placed by its neighbours in its own file:

CasePosition
Follows an entry in its own fileRight after that entry
Follows no entry, file matches some entryFirst
File matches no entry beneath itAppended at the end
peer.toml
[[commit.slots]]
name = "gitmoji"
kind = "symbols"

[[commit.slots]]
name = "keywords"
required = true

[[commit.slots]]
name = "scope"
kind = "word"

Result of extends = ["base.toml", "peer.toml"]: gitmoji, keywords, scope, separator.

before

before = "<name>" places the entry ahead of the named entry, moving it if already present.

extends = "base.toml"

[[commit.slots]]
name = "gitmoji"
kind = "word"
before = "keywords"

Result: gitmoji, keywords, separator.

drop

drop = true removes the named entry.

extends = "npm:@atypical/commit/conventional"

[[commit.slots]]
name = "scope"
drop = true

Order in extends

Swapping two targets can produce a different grammar.

extendsLeading slots
[conventional, gitmoji]intention, keywords, ...
[gitmoji, conventional]keywords, intention, ...

Errors

ErrorCause
`before = "x"` in <path> names no other entryx is absent, or is the entry itself
two entries named "x" in one array in <path>One file gives two entries of one array the same name

On this page