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.

Flagged
deck.json
{ "title": "Pricing", "slides": [{ "file": "slides/risks.mdx" }] }
slides/risks.mdx
## Risks

<Branch to="pricing">Pricing risk</Branch>
Build output
slides/risks.mdx: [branch-target-missing] <Branch to="pricing"> does not match a branch id or slide name in deck.json
Passes
deck.json
{
  "title": "Pricing",
  "slides": [
    {
      "file": "slides/risks.mdx",
      "branches": [
        {
          "id": "pricing",
          "label": "Pricing risk",
          "slides": [{ "file": "slides/pricing.mdx" }]
        }
      ]
    }
  ]
}
slides/risks.mdx
## Risks

<Branch to="pricing">Pricing risk</Branch>
slides/pricing.mdx
## Pricing
Build output

No findings.

branch-unlinked warn

Every branch needs a <Branch> link on its parent slide, or viewers can't reach it.

No options.

Flagged
deck.json
{
  "title": "Pricing",
  "slides": [
    {
      "file": "slides/risks.mdx",
      "branches": [
        {
          "id": "pricing",
          "label": "Pricing risk",
          "slides": [{ "file": "slides/pricing.mdx" }]
        }
      ]
    }
  ]
}
slides/risks.mdx
## Risks
slides/pricing.mdx
## Pricing
Build output
slides/risks.mdx: [branch-unlinked] Nothing links to branch "pricing", so viewers can’t reach it. Add <Branch to="pricing">…</Branch> to this slide.
Passes
deck.json
{
  "title": "Pricing",
  "slides": [
    {
      "file": "slides/risks.mdx",
      "branches": [
        {
          "id": "pricing",
          "label": "Pricing risk",
          "slides": [{ "file": "slides/pricing.mdx" }]
        }
      ]
    }
  ]
}
slides/risks.mdx
## Risks

<Branch to="pricing">Pricing risk</Branch>
slides/pricing.mdx
## Pricing
Build output

No 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.

Flagged
slides/revenue-q3.mdx
## Revenue tripled
style.css
[data-slide-id="revenue"] h2 {
  color: var(--accent);
}
Build output
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.
Passes
slides/revenue.mdx
## Revenue tripled
style.css
[data-slide-id="revenue"] h2 {
  color: var(--accent);
}
Build output

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.

OptionDefaultDescription
max5Most overrides one slide may have, counting each inline style property and each scoped declaration
Flagged
slides/revenue.mdx
## Revenue tripled

<Stat value="3.1×" label="year over year" style={{ color: "var(--accent)", fontSize: "1.4em" }} />
style.css
[data-slide-id="revenue"] h2 {
  font-size: 2.4em;
  letter-spacing: -0.02em;
  margin-bottom: 0.4em;
  color: var(--accent);
}
Build output
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.
Passes
slides/revenue.mdx
## Revenue tripled

<Stat value="3.1×" label="year over year" className="hero-stat" />
style.css
.hero-stat {
  color: var(--accent);
  font-size: 1.4em;
}
Build output

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.

OptionDefaultDescription
maxPx2px values up to this size are allowed, for hairlines
Flagged
slides/cover.mdx
# Q3 review
style.css
h1.md {
  font-size: 64px;
  border-bottom: 1px solid var(--muted);
}
Build output
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).
Passes
slides/cover.mdx
# Q3 review

<Chart />
components/Chart.tsx
export function Chart() {
  return (
    <svg viewBox="0 0 400 200">
      <text className="chart-label" x="20" y="100">Q3</text>
    </svg>
  );
}
style.css
h1.md {
  font-size: 9cqmin;
  border-bottom: 1px solid var(--muted);
}

.chart-label {
  font-size: 14px;
}
Build output

No findings.