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
Add attributes
setting
#979
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be a bit confused; i was suggesting only a setting, and no rule config changes at all.
@@ -103,6 +104,7 @@ This rule takes one optional object argument of type object: | |||
} | |||
``` | |||
|
|||
`htmlForAttributes`: is an array of strings that specify the attribute to check for an associated control. Default is `["htmlFor"]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just this one? Why not an object map, so we can always handle class/className, and any others that are needed?
@@ -10,7 +10,8 @@ export type ESLintSettings = { | |||
[string]: mixed, | |||
'jsx-a11y'?: { | |||
polymorphicPropName?: string, | |||
components?: {[string]: string}, | |||
components?: { [string]: string }, | |||
attributes?: { for?: string[] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the name “attributes” or “htmlForAttributes”?
Uh I am sorry, I thought it was a good idea to make the rule configurable too. I'll drop rule options, keeping the global setting. |
This Pull Request replaces PR #977 and introduces a global setting to configure attributes, as suggested here.
It allows
for
attribute support forlabel-has-associated-control
rule.Related issues: #894, #961