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

Commit

Permalink
add eslint rule for no-target-blank in jsx, fix occurences (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
earnubs committed Mar 20, 2017
1 parent 3af1f4b commit f9044c0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Expand Up @@ -32,6 +32,9 @@ module.exports = {
'SwitchCase': 1
}
],
'react/jsx-no-target-blank': [
2
],
'react/jsx-indent': [
'error',
2
Expand Down
10 changes: 9 additions & 1 deletion src/common/components/help/install-snap/index.js
Expand Up @@ -20,7 +20,15 @@ export default class HelpInstallSnap extends Component {
</code>
</pre>
<p className={ styles.p }>
Don’t have snapd installed? <a className={ styles.external } href={ HELP_INSTALL_URL } target="_blank">Install it now</a>.
Don’t have snapd installed? {' '}
<a
className={ styles.external }
href={ HELP_INSTALL_URL }
rel="noreferrer noopener"
target="_blank"
>
Install it now
</a>.
</p>
</div>
);
Expand Down
Expand Up @@ -19,7 +19,12 @@ const getErrorCode = (error) => {
const Agreement = (props) => {
const checkbox = <input type="checkbox" onChange={ props.onChange } />;
const link = (
<a className={ styles.external } href={ AGREEMENT_URL } target="_blank">
<a
className={ styles.external }
href={ AGREEMENT_URL }
target="_blank"
rel="noreferrer noopener"
>
Developer Programme Agreement
</a>
);
Expand Down Expand Up @@ -136,7 +141,14 @@ const Caption = (props) => {
<p><ErrorIcon /> Sorry, { reason }. Try a different name.</p>
<p className={ styles.helpText }>
If you think you should have sole rights to the name,
you can <a href={ FILE_NAME_CLAIM_URL } target='_blank'>file a claim</a>.
you can
<a
href={ FILE_NAME_CLAIM_URL }
target='_blank'
rel="noreferrer noopener"
>
file a claim
</a>.
</p>
</div>
);
Expand Down
Expand Up @@ -40,14 +40,32 @@ const UnconfiguredDropdown = (props) => {
installable, and runnable.
</p>
<p className={ styles.helpText }>
<a href={ LEARN_THE_BASICS_LINK } target="_blank">Learn the basics</a>,
or
<a href={ getTemplateUrl(snap) } target="_blank"> get started with a template</a>.
<a
href={ LEARN_THE_BASICS_LINK }
target="_blank"
rel="noreferrer noopener"
>
Learn the basics
</a>,
or {' '}
<a
href={ getTemplateUrl(snap) }
target="_blank"
rel="noreferrer noopener"
>
get started with a template
</a>.
</p>
<p className={ styles.helpText }>
Don’t have snapcraft?
<a href={ INSTALL_IT_LINK } target="_blank"> Install it on your own PC </a>
for testing.
Don’t have snapcraft? {' '}
<a
href={ INSTALL_IT_LINK }
target="_blank"
rel="noreferrer noopener"
>
Install it on your own PC
</a>
{' '} for testing.
</p>
</Data>
</Row>
Expand Down

0 comments on commit f9044c0

Please sign in to comment.