Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit f9044c0

Browse files
authored
add eslint rule for no-target-blank in jsx, fix occurences (#477)
1 parent 3af1f4b commit f9044c0

File tree

4 files changed

+50
-9
lines changed

4 files changed

+50
-9
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ module.exports = {
3232
'SwitchCase': 1
3333
}
3434
],
35+
'react/jsx-no-target-blank': [
36+
2
37+
],
3538
'react/jsx-indent': [
3639
'error',
3740
2

src/common/components/help/install-snap/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ export default class HelpInstallSnap extends Component {
2020
</code>
2121
</pre>
2222
<p className={ styles.p }>
23-
Don’t have snapd installed? <a className={ styles.external } href={ HELP_INSTALL_URL } target="_blank">Install it now</a>.
23+
Don’t have snapd installed? {' '}
24+
<a
25+
className={ styles.external }
26+
href={ HELP_INSTALL_URL }
27+
rel="noreferrer noopener"
28+
target="_blank"
29+
>
30+
Install it now
31+
</a>.
2432
</p>
2533
</div>
2634
);

src/common/components/repository-row/dropdowns/register-name-dropdown.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ const getErrorCode = (error) => {
1919
const Agreement = (props) => {
2020
const checkbox = <input type="checkbox" onChange={ props.onChange } />;
2121
const link = (
22-
<a className={ styles.external } href={ AGREEMENT_URL } target="_blank">
22+
<a
23+
className={ styles.external }
24+
href={ AGREEMENT_URL }
25+
target="_blank"
26+
rel="noreferrer noopener"
27+
>
2328
Developer Programme Agreement
2429
</a>
2530
);
@@ -136,7 +141,14 @@ const Caption = (props) => {
136141
<p><ErrorIcon /> Sorry, { reason }. Try a different name.</p>
137142
<p className={ styles.helpText }>
138143
If you think you should have sole rights to the name,
139-
you can <a href={ FILE_NAME_CLAIM_URL } target='_blank'>file a claim</a>.
144+
you can
145+
<a
146+
href={ FILE_NAME_CLAIM_URL }
147+
target='_blank'
148+
rel="noreferrer noopener"
149+
>
150+
file a claim
151+
</a>.
140152
</p>
141153
</div>
142154
);

src/common/components/repository-row/dropdowns/unconfigured-dropdown.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,32 @@ const UnconfiguredDropdown = (props) => {
4040
installable, and runnable.
4141
</p>
4242
<p className={ styles.helpText }>
43-
<a href={ LEARN_THE_BASICS_LINK } target="_blank">Learn the basics</a>,
44-
or
45-
<a href={ getTemplateUrl(snap) } target="_blank"> get started with a template</a>.
43+
<a
44+
href={ LEARN_THE_BASICS_LINK }
45+
target="_blank"
46+
rel="noreferrer noopener"
47+
>
48+
Learn the basics
49+
</a>,
50+
or {' '}
51+
<a
52+
href={ getTemplateUrl(snap) }
53+
target="_blank"
54+
rel="noreferrer noopener"
55+
>
56+
get started with a template
57+
</a>.
4658
</p>
4759
<p className={ styles.helpText }>
48-
Don’t have snapcraft?
49-
<a href={ INSTALL_IT_LINK } target="_blank"> Install it on your own PC </a>
50-
for testing.
60+
Don’t have snapcraft? {' '}
61+
<a
62+
href={ INSTALL_IT_LINK }
63+
target="_blank"
64+
rel="noreferrer noopener"
65+
>
66+
Install it on your own PC
67+
</a>
68+
{' '} for testing.
5169
</p>
5270
</Data>
5371
</Row>

0 commit comments

Comments
 (0)