Skip to content

docs: use json5 for bare object literal code blocks - #54122

Merged
MarshallOfSound merged 3 commits into
45-x-yfrom
trop/45-x-y-bp-docs-use-json5-for-bare-object-literal-code-blocks-1789859098319
Sep 19, 2026
Merged

MarshallOfSound merged 3 commits into
45-x-yfrom
trop/45-x-y-bp-docs-use-json5-for-bare-object-literal-code-blocks-1789859098319

Conversation

@trop

@trop trop Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Backport of #54107

See that PR for details.

Notes: none

trop Bot and others added 3 commits September 19, 2026 23:05
Several docs code blocks contain only a bare object literal (an example
return value or options object) but are tagged as `js`. As JavaScript,
`{ key: value, ... }` on its own is a block statement, not an object, so
standard/ESLint reports "Parsing error: Unexpected token :" on most of
them; they only lint today because @electron/lint-roller special-cases
them with a regex that wraps orphan `{...}` blocks in parens before
linting. The blocks are valid JSON5, so tag them as such and drop the
`<!-- eslint-skip -->` comments that preceded them, which nothing in the
current tooling honors.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NBwKFgaRoEHjxoyGFpU6Ck

Co-authored-by: Claude <[email protected]>
The three menu template examples in docs/tutorial/menus.md are bare
array literals, not runnable JavaScript. Like the bare object literal
blocks in the previous commit, they are valid JSON5, so tag them as
such instead of `js`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NBwKFgaRoEHjxoyGFpU6Ck

Co-authored-by: Claude <[email protected]>
The radio menu item example in the `[!TIP]` blockquote in
docs/tutorial/menus.md is a bare array literal tagged `js`; it was
missed earlier because the fence is prefixed with `> `. It is valid
JSON5 (including the trailing `//` comment), so tag it json5 like the
other bare literal blocks.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NBwKFgaRoEHjxoyGFpU6Ck

Co-authored-by: Claude <[email protected]>
@trop trop Bot mentioned this pull request Sep 19, 2026
4 tasks done
@trop trop Bot added 45-x-y backport This is a backport PR semver/none labels Sep 19, 2026
@MarshallOfSound
MarshallOfSound merged commit be88c25 into 45-x-y Sep 19, 2026
62 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/45-x-y-bp-docs-use-json5-for-bare-object-literal-code-blocks-1789859098319 branch September 19, 2026 23:17
@release-clerk

release-clerk Bot commented Sep 19, 2026

Copy link
Copy Markdown

No Release Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant