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

New strictTemplates option causes issues with data-* attributes #1561

Closed
2-5 opened this issue Jul 11, 2022 · 5 comments
Closed

New strictTemplates option causes issues with data-* attributes #1561

2-5 opened this issue Jul 11, 2022 · 5 comments
Labels
question Further information is requested

Comments

@2-5
Copy link
Contributor

2-5 commented Jul 11, 2022

It seems the fix for #1413 is not complete, I'm seeing data-* errors with the latest Volar and strictTemplates on.

data

@johnsoncodehk
Copy link
Member

See #1418 (comment).
You need to define HTMLAttributes interface to allow data-*, see #1077 (comment).

@johnsoncodehk johnsoncodehk added the question Further information is requested label Sep 21, 2022
@rchl
Copy link
Collaborator

rchl commented Sep 22, 2022

A suggestion to manually add definitions for all attributes that are already valid HTML attributes doesn't really make sense to me. This applies both to data-* and aria-*.

And I suppose mine #1871 is a duplicate.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Sep 22, 2022

@rchl we can't differentiate data-*, aria-* from user code is HTML attributes or valid component props, if force discern it to HTML attributes it will lead to #1413. Requiring the project to explicitly define HTMLAttributes for this seems to be the only way for now.

@rchl
Copy link
Collaborator

rchl commented Sep 22, 2022

I understand that there might be technical difficulties with solving it but if Volar strives to be user-friendly official Vue language server then it can't require everyone to do such basic things.

We should at least keep some issue open for it so that it's clear that it's a bug (or something to solve at some point) and not make this suggestion an official response.

Maybe the solution would be for volar to include definitions for known HTML attributes (would work for aria-* at least).

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Nov 27, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants