f9ed1bf2c9
Typescript's type aliases (`type X = thing`) can refer to basically anything, which makes it hard to write an automatic document formatter for them. Interfaces on the other hand are only object, so they play much nicer with docs. Currently, object-flavoured type aliases don't really get expanded at all on our docs site, which means we have a bunch of docs content that's not shown on the site. This diff introduces a lint rule that forces `interface X {foo: bar}`s instead of `type X = {foo: bar}` where possible, as it results in a much better documentation experience: Before: <img width="437" alt="Screenshot 2024-05-22 at 15 24 13" src="https://github.com/tldraw/tldraw/assets/1489520/32606fd1-6832-4a1e-aa5f-f0534d160c92"> After: <img width="431" alt="Screenshot 2024-05-22 at 15 33 01" src="https://github.com/tldraw/tldraw/assets/1489520/4e0d59ee-c38e-4056-b9fd-6a7f15d28f0f"> ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `docs` — Changes to the documentation, examples, or templates. - [x] `improvement` — Improving existing features |
||
---|---|---|
.. | ||
export-snapshots.spec.ts-snapshots | ||
fixtures | ||
test-canvas-events.spec.ts-snapshots | ||
export-snapshots.spec.ts | ||
test-actions-menu.spec.ts | ||
test-api.spec.ts | ||
test-camera.spec.ts | ||
test-canvas-events.spec.ts | ||
test-clipboard.spec.ts | ||
test-context-menu.spec.ts | ||
test-focus.spec.ts | ||
test-help-menu.spec.ts | ||
test-kbds.spec.ts | ||
test-main-menu.spec.ts | ||
test-navigation-panel.spec.ts | ||
test-page-menu.spec.ts | ||
test-routes.spec.ts | ||
test-shapes.spec.ts | ||
test-smoke.spec.ts | ||
test-style-panel.spec.ts | ||
test-text.spec.ts | ||
test-toolbar.spec.ts |