Repository navigation
v0.7.8
Summary
0.7.8 adds two lint rules that catch component code drifting from Nativele's design, and states the design principles in docs/design.md. Both rules are data-flow warnings whose Fix: links the principle they rest on.
Changes
- Lint rule
static-markup-in-code(data-flow, warning): a component class that creates an element withdocument.createElementand gives it a fixed text or attribute in the same block (b.textContent = "Remove",b.type = "button",setAttributewith a literal), structure the template can hold. A value that adds data, a write to another element, comments and strings are not reported, nor is an element whose content comes from data. - Lint rule
dom-node-in-state(data-flow, warning): astateorpropsvalue that holds several DOM nodes ([] as HTMLElement[],new Set<HTMLElement>(), aDocumentFragment), a copy of what the DOM holds. A single element such as an anchor a parent passes in is not reported. docs/design.mdstates the design principles in five parts: HTML describes, TypeScript decides; the browser is the runtime; data flows one way; small surface, checked by tools; integrations stay at the edge.npx ts-dom rules --explain=<id>explains both rules with an example.
Breaking Changes
None. New lint rules are warnings.