alpinejs-devtools
alpinejs-devtools copied to clipboard
Markup warnings/lint
trafficstars
Additional things we can write our own "warning" for (see https://github.com/alpinejs/alpine/discussions/975)
x-initon an element withoutx-data(v2)- Alpine directives outside of
x-data - Alpine is loaded but there is no
x-dataon the page - an alpine directive is being used on an element that doesn't have x-data and has no element with
x-datain its ancestors - x-if/x-for on a non-template element
- template with more than 1 child node
We need to have a think about how to highlight template's that have issues (they're visually hidden... maybe having warnings is enough).
Originally posted by @HugoDF in https://github.com/alpine-collective/alpinejs-devtools/issues/126#issuecomment-757334781
x-for requires a non-template child (whereas x-if does not require this)
There are only three valid templates (these, and only these, attributes may appear)
1. x-if
2. x-for
3. x-for :key
Maybe relevant discussion for a warning https://github.com/alpinejs/alpine/discussions/1038