Skip to content

Commit 1b6cef9

Browse files
authored
Improve formatting in jsx-no-target-blank docs
Added some backticks around code, and changing the code formatting to JSX from JS.
1 parent 7cd6bd0 commit 1b6cef9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/rules/jsx-no-target-blank.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Prevent usage of unsafe target='_blank' (jsx-no-target-blank)
22

33
When creating a JSX element that has an a tag, it is often desired to have
4-
the link open in a new tab using the target='_blank' attribute. Using this
5-
attribute unaccompanied by rel='noreferrer noopener', however, is a severe
4+
the link open in a new tab using the `target='_blank'` attribute. Using this
5+
attribute unaccompanied by `rel='noreferrer noopener'`, however, is a severe
66
security vulnerability ([see here for more details](https://mathiasbynens.github.io/rel-noopener))
7-
This rules requires that you accompany all target='_blank' attributes with rel='noreferrer noopener'.
7+
This rules requires that you accompany all `target='_blank'` attributes with `rel='noreferrer noopener'`.
88

99
## Rule Details
1010

1111
The following patterns are considered errors:
1212

13-
```javascript
13+
```jsx
1414
var Hello = <a target='_blank'></a>
1515
```
1616

1717
The following patterns are not considered erros:
1818

19-
```javascript
19+
```jsx
2020
var Hello = <p target='_blank'></p>
2121
var Hello = <a target='_blank' rel='noopener noreferrer'></a>
2222
var Hello = <a></a>

0 commit comments

Comments
 (0)