Dusty Pomerleau on Nostr: Prettier accepts config files in TOML, which I prefer, but I have a line in my (JS) ...
Prettier accepts config files in TOML, which I prefer, but I have a line in my (JS) config that I can’t seem to translate:
`overrides: [{ files: "*.md", options: { tabWidth: 2 } }],`
In JS, overrides is an array of objects, so I assume the TOML equivalent would be an array of tables (`[[overrides]]`), but if each override table is a value, what is the key? In JS the objects in the array are just anonymous. Prettier docs don't give any examples of this pattern in TOML.
#prettier #TOML
Published at
2024-07-22 03:21:50Event JSON
{
"id": "55392b783a143bc9912e3ba79d6339a26dfcc2773381ed3518d7a03818b29b0b",
"pubkey": "5bdfe5c3188a24f76efd37648930d8ada3e458961d03b2e0d62596d4f76e4778",
"created_at": 1721618510,
"kind": 1,
"tags": [
[
"t",
"prettier"
],
[
"t",
"toml"
],
[
"proxy",
"https://fosstodon.org/users/dpom/statuses/112827990695355317",
"activitypub"
]
],
"content": "Prettier accepts config files in TOML, which I prefer, but I have a line in my (JS) config that I can’t seem to translate:\n\n`overrides: [{ files: \"*.md\", options: { tabWidth: 2 } }],`\n\nIn JS, overrides is an array of objects, so I assume the TOML equivalent would be an array of tables (`[[overrides]]`), but if each override table is a value, what is the key? In JS the objects in the array are just anonymous. Prettier docs don't give any examples of this pattern in TOML.\n\n#prettier #TOML",
"sig": "9625e05529a9c1323110cb59e575e82fba56df15d621a2dc9088534d4ac4e3c0e114664bfe415b0d6157b338fe6678461523a58ee146539b1066938ba9c5fbe0"
}