Repository navigation
v0.7.1
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):anyin a component'sstate,props,derive,emitsdetails, its template (Template<any>or an untypedTemplate), a handler member or a handler's first parameter is a tsc contract error, whichts-dom checkreports at the declaring key, theComponent(...)call or thedata-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, sonull as HTMLElement | nullor aCustomEventin state is not reported.unknownnever triggers it.anyfrom outside types: ananyin lib.dom, a third-party element class,HTMLElementTagNameMapor 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 intounknown.- Library source:
typescript/no-explicit-anyis 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 --a11yabout 330 to 295 ms); a DOM-typed state field no longer expands lib.dom in tsc. - Skills:
nativele-lintingexplains whereanyis reported and in which order; re-verified by an agent trial.
Breaking Changes
- Code with
anyin a component contract now failstsc(anyInContract: "props.item"and the like): declare a specific type, orunknownand narrow it where it is read. Component(template([...]))without type arguments (an untypedTemplate) is nowanyInContract: "template": import the template from its./x.html.jsmodule.