Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markup warnings/lint #141

Open
HugoDF opened this issue Jan 9, 2021 · 2 comments
Open

Markup warnings/lint #141

HugoDF opened this issue Jan 9, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@HugoDF
Copy link
Collaborator

HugoDF commented Jan 9, 2021

Additional things we can write our own "warning" for (see alpinejs/alpine#975)

  • x-init on an element without x-data (v2)
  • Alpine directives outside of x-data
  • Alpine is loaded but there is no x-data on the page
  • an alpine directive is being used on an element that doesn't have x-data and has no element with x-data in 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 #126 (comment)

@HugoDF HugoDF added the enhancement New feature or request label Jan 9, 2021
@HugoDF HugoDF added this to the v1.0.0 [unreleased] milestone Jan 9, 2021
@HugoDF HugoDF removed this from the v1.0.0 [unreleased] milestone Jan 9, 2021
@markfirmware
Copy link

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

@HugoDF
Copy link
Collaborator Author

HugoDF commented Jan 26, 2021

Maybe relevant discussion for a warning alpinejs/alpine#1038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants