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

Allow bind syntax for "label-has-for" #529

Closed
aKzenT opened this issue Jul 12, 2022 · 8 comments
Closed

Allow bind syntax for "label-has-for" #529

aKzenT opened this issue Jul 12, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@aKzenT
Copy link

aKzenT commented Jul 12, 2022

We sometimes have components that combine form elements and labels:

       <label :for="id" ...>
       <input :id="id" ...>

id in this case is a property set on the custom component.

Unfortunately the plugin ignores :for completely and complains about missing for attribute.

@vhoyer vhoyer added the bug Something isn't working label Jul 20, 2022
@vhoyer
Copy link
Collaborator

vhoyer commented Jul 20, 2022

can you provide a short reproduction of this behavior so we can try fixing it properly?

@RieMars
Copy link

RieMars commented Aug 17, 2022

This is yet another barrier to Vue3 adoption. If Vue allows binding with :for then this should be part of the linting rules.

@vhoyer
Copy link
Collaborator

vhoyer commented Aug 17, 2022

As far as I could tell, it is a problem both in vue@2 and vue@3, but anyway, could you, then, provide a reproduction link?

@RieMars
Copy link

RieMars commented Aug 19, 2022

There's an example - Vue SFC Link

And regarding the Vue3 comment, I just started encountering this issue as I was forced to upgrade to Vue3 and used the ESLint AirBnB preset. That preset required me to get familiar with disabling a lot of rules that just didn't work with legit code like this one.

@cniklas
Copy link

cniklas commented Nov 12, 2022

Any updates on this topic?

@kddnewton
Copy link
Collaborator

A PR would be merged if someone wants to put one together.

@vhoyer
Copy link
Collaborator

vhoyer commented Nov 14, 2022

So, I just gave this a look, and I'm pretty sure that this is an issue with your configuration, also it should be related to this other issue: #54 (in this other issue there are some recommendations of workarounds, but PRs are still welcomed to fix that issue).

and as far as I can tell, it does not have anything to do with Vue@3.

The reproduction I made is here: https://github.com/vhoyer-bug-reproductions/eslint-plugin-vuejs-accessibility

if you think there was a mistake in my judgement feel free to re-open this issue


EDIT: as the reproduction link provided didn't have any information about the configuration used, I assumed the recommended

@vhoyer vhoyer closed this as completed Nov 14, 2022
@cniklas
Copy link

cniklas commented Nov 14, 2022

So, I just gave this a look, and I'm pretty sure that this is an issue with your configuration, also it should be related to this other issue: #54 (in this other issue there are some recommendations of workarounds, but PRs are still welcomed to fix that issue).

and as far as I can tell, it does not have anything to do with Vue@3.

The reproduction I made is here: https://github.com/vhoyer-bug-reproductions/eslint-plugin-vuejs-accessibility

if you think there was a mistake in my judgement feel free to re-open this issue

EDIT: as the reproduction link provided didn't have any information about the configuration used, I assumed the recommended

Thanks for sharing the reproduction code example. Going along your configuration over there fixed the issue for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants