Skip to content

v0.7.1

Choose a tag to compare

@github-actions github-actions released this 07 Nov 16:30
a34a718

Summary

Nativele 0.7.1 makes any unable to switch the HTML–TypeScript checks off, and makes lint and codegen faster.

Changes

  • any-in-contract (new check): any in a component's state, props, derive, emits details, its template (Template<any> or an untyped Template), a handler member or a handler's first parameter is a tsc contract error, which ts-dom check reports at the declaring key, the Component(...) call or the data-on-* attribute, with a Fix. Only the data the component declares is looked into (objects, arrays, tuples, index signatures, Map, Set); DOM and other library types stop the search, so null as HTMLElement | null or a CustomEvent in state is not reported. unknown never triggers it.
  • any from outside types: an any in lib.dom, a third-party element class, HTMLElementTagNameMap or a child's contract is treated as not declared everywhere the types look things up, instead of satisfying a check by accident or turning an event into unknown.
  • Library source: typescript/no-explicit-any is an error in the repository's own lint.
  • Performance: each scanned folder is read once per run; the declared props and emits of each component are kept between runs; each folder's package is found once per run (1000 components: single-file oxlint re-lint about 21 to 13 ms, Vite template save about 45 to 29 ms, lint --a11y about 330 to 295 ms); a DOM-typed state field no longer expands lib.dom in tsc.
  • Skills: nativele-linting explains where any is reported and in which order; re-verified by an agent trial.

Breaking Changes

  • Code with any in a component contract now fails tsc (anyInContract: "props.item" and the like): declare a specific type, or unknown and narrow it where it is read.
  • Component(template([...])) without type arguments (an untyped Template) is now anyInContract: "template": import the template from its ./x.html.js module.