-
-
Notifications
You must be signed in to change notification settings - Fork 736
docs(linter): Fix jsx-a11y/img-redundant-alt configuration option names.
#16552
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
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.
Pull request overview
This PR fixes a bug in the jsx-a11y/img-redundant-alt linter rule where the configuration option names in the struct didn't match the keys used in the from_configuration() method. The internal field names types_to_validate and redundant_words have been renamed to components and words respectively, aligning with what users actually configure in their .oxlintrc.json files. Additionally, a minor typo in the diagnostic help message was corrected.
Key Changes:
- Renamed internal struct fields to match user-facing configuration keys (
types_to_validate→components,redundant_words→words) - Fixed punctuation typo in diagnostic message (
`photo,`→`photo`)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs | Updated struct field names and all references to align with configuration keys; fixed punctuation in diagnostic help message |
| crates/oxc_linter/src/snapshots/jsx_a11y_img_redundant_alt.snap | Updated snapshot to reflect the corrected diagnostic help message punctuation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #16552 will not alter performanceComparing Summary
Footnotes
|
…mes. These were wrong previously due to the fields having different names in the config object than the actual configuration passed to the rule. Also, I'm not sure that the tests for this rule adequately cover the configuration options? I didn't update those here, though. Separate problem.
The last two are commented-out, but are from the upstream rule's tests. Also add a todo message for the diagnostic.
fb377b5 to
b6b60c6
Compare
Also rename 'array' to 'config_array' for clarity.
|
Added a few tests and some notes on fixes that need to be made in the future, ready to go now. |
These were wrong previously due to the fields having different names in the config object than the actual configuration passed to the rule. The docs will now match the result we expect to see from the
Also updated the tests to cover more cases, and found a few places where the current logic is problematic.
Generated docs: