Linting
Every build checks a deck against a set of rules for things that compile fine but make a worse deck. Findings come back from write_files, preview_deck and publish_deck with file, line and the rule id in brackets, so your AI can fix them as it writes. An error fails the build, so the deck can't be previewed or published until it's fixed; a warn is reported and doesn't block anything.
A deck can change any rule's severity (off, warn, error) or options in deck.json:
{
"lint": { "style-overrides": ["warn", { "max": 5 }], "fixed-units": "off" }
}branch-target-missing error
A <Branch to> link must point at a branch id or slide name in deck.json.
No options.
{ "title": "Pricing", "slides": [{ "file": "slides/risks.mdx" }] }## Risks
<Branch to="pricing">Pricing risk</Branch>slides/risks.mdx: [branch-target-missing] <Branch to="pricing"> does not match a branch id or slide name in deck.json{
"title": "Pricing",
"slides": [
{
"file": "slides/risks.mdx",
"branches": [
{
"id": "pricing",
"label": "Pricing risk",
"slides": [{ "file": "slides/pricing.mdx" }]
}
]
}
]
}## Risks
<Branch to="pricing">Pricing risk</Branch>## PricingNo findings.
branch-unlinked warn
Every branch needs a <Branch> link on its parent slide, or viewers can't reach it.
No options.
{
"title": "Pricing",
"slides": [
{
"file": "slides/risks.mdx",
"branches": [
{
"id": "pricing",
"label": "Pricing risk",
"slides": [{ "file": "slides/pricing.mdx" }]
}
]
}
]
}## Risks## Pricingslides/risks.mdx: [branch-unlinked] Nothing links to branch "pricing", so viewers can’t reach it. Add <Branch to="pricing">…</Branch> to this slide.{
"title": "Pricing",
"slides": [
{
"file": "slides/risks.mdx",
"branches": [
{
"id": "pricing",
"label": "Pricing risk",
"slides": [{ "file": "slides/pricing.mdx" }]
}
]
}
]
}## Risks
<Branch to="pricing">Pricing risk</Branch>## PricingNo findings.
slide-selector-missing error
A [data-slide-id] selector in style.css must name a slide in deck.json. A slide's id is its file name, so renaming the file silently drops the styles scoped to it.
No options.
## Revenue tripled[data-slide-id="revenue"] h2 {
color: var(--accent);
}style.css:1:1: [slide-selector-missing] [data-slide-id="revenue"] matches no slide in deck.json. Slide ids are file names without .mdx: point the selector at the slide's file name, or give the slide back its old name.## Revenue tripled[data-slide-id="revenue"] h2 {
color: var(--accent);
}No findings.
style-overrides warn
A slide should not carry many one-off styles: inline style props plus style.css declarations scoped to it with [data-slide-id]. Move repeated looks into a shared class in style.css or a component.
| Option | Default | Description |
|---|---|---|
max | 5 | Most overrides one slide may have, counting each inline style property and each scoped declaration |
## Revenue tripled
<Stat value="3.1×" label="year over year" style={{ color: "var(--accent)", fontSize: "1.4em" }} />[data-slide-id="revenue"] h2 {
font-size: 2.4em;
letter-spacing: -0.02em;
margin-bottom: 0.4em;
color: var(--accent);
}slides/revenue.mdx:3: [style-overrides] 6 style overrides on this slide (2 inline style properties, 4 declarations under [data-slide-id="revenue"] in style.css); the limit is 5. Move them into a shared class in style.css or a component so slides stay consistent.## Revenue tripled
<Stat value="3.1×" label="year over year" className="hero-stat" />.hero-stat {
color: var(--accent);
font-size: 1.4em;
}No findings.
fixed-units warn
Size things in style.css with cqmin or em, not px, so one slide works on the 16:9 stage and on phone stories. Rules that only style SVG content are skipped, since px there are viewBox units.
| Option | Default | Description |
|---|---|---|
maxPx | 2 | px values up to this size are allowed, for hairlines |
# Q3 reviewh1.md {
font-size: 64px;
border-bottom: 1px solid var(--muted);
}style.css:2:3: [fixed-units] "font-size: 64px" uses px, which doesn't scale with the slide. Use cqmin or em (64px is about 8.9cqmin on the desktop stage).# Q3 review
<Chart />export function Chart() {
return (
<svg viewBox="0 0 400 200">
<text className="chart-label" x="20" y="100">Q3</text>
</svg>
);
}h1.md {
font-size: 9cqmin;
border-bottom: 1px solid var(--muted);
}
.chart-label {
font-size: 14px;
}No findings.