Esc

COMARK0702 · warning

comark/diff/undefined-binding

Bind ::diff props to data that exists

A prop written with a : reads its value from the frontmatter or the document's meta. When nothing is at that path, the prop is empty, so the diff loses its line numbers or its file name. Bindings to data or props are left alone, since the renderer fills those in.

Incorrect

---
start: 12
---

::diff{:line="frontmatter.line"}
```ts [src/ducks.ts]
const meals = 1
```
```ts
const meals = 2
```
::
md
lint-comark example.mdexample.md:5:1 comark/diff/undefined-bindingdiff "src/ducks.ts": :line points at frontmatter.line, which is undefined.Fix the path or set line directly.✖ 1 problem

Correct

---
start: 12
---

::diff{:line="frontmatter.start"}
```ts [src/ducks.ts]
const meals = 1
```
```ts
const meals = 2
```
::
md
lint-comark example.md✔ No problems