Skip to content

【Fix】: alt-text string null determination#1013

Draft
taku10101 wants to merge 1 commit intojsx-eslint:mainfrom
taku10101:main
Draft

【Fix】: alt-text string null determination#1013
taku10101 wants to merge 1 commit intojsx-eslint:mainfrom
taku10101:main

Conversation

@taku10101
Copy link
Copy Markdown

closed #971

@taku10101 taku10101 changed the title 【Fix】: string null determination 【Fix】: alt-text string null determination Oct 6, 2024
Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need some tests to show what bug is being fixed.

Comment thread src/rules/alt-text.js
return false;
}
if (typeof value === 'string' && value.length === 0) {
if (typeof value === 'string' && value.length === 0 && value === '') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value === '' and value.length === 0, when it's already a string, are the same condition.

Suggested change
if (typeof value === 'string' && value.length === 0 && value === '') {
if (typeof value === 'string' && value.length === 0) {

@ljharb ljharb marked this pull request as draft December 24, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

alt-text: missing warning for empty alt for <input type="image" alt="" />

2 participants