Skip to content

Commit 76fcbbf

Browse files
katharinafluchljharb
authored andcommitted
[docs] fix alt-text code sample
1 parent 15ae674 commit 76fcbbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/rules/alt-text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ An `<img>` must have the `alt` prop set with meaningful text or as an empty stri
1414

1515
For images that are being used as icons for a button or control, the `alt` prop should be set to an empty string (`alt=""`).
1616

17-
```js
17+
```jsx
1818
<button>
1919
<img src="icon.png" alt="" />
2020
Save
@@ -38,7 +38,7 @@ This rule takes one optional object argument of type object:
3838
```json
3939
{
4040
"rules": {
41-
"jsx-a11y/img-has-alt": [ 2, {
41+
"jsx-a11y/alt-text": [ 2, {
4242
"elements": [ "img", "object", "area", "input[type=\"image\"]" ],
4343
"img": ["Image"],
4444
"object": ["Object"],

0 commit comments

Comments
 (0)