Skip to content

Commit

Permalink
jsx-no-target-blank Update documentation with new options links and f…
Browse files Browse the repository at this point in the history
…orms
  • Loading branch information
jaaberg committed Dec 19, 2017
1 parent dbe2f72 commit 49895aa
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/rules/jsx-no-target-blank.md
Expand Up @@ -26,26 +26,26 @@ var Hello = <a></a>

### Options

There is only one option:

* `preventInForms` - Prevent usage of unsafe `target='_blank'` inside forms
```js
"react/jsx-no-target-blank": [<enabled>, {
"links": <boolean>,
"forms": <boolean>
}]
```

To use, you can specify like the following:
* `links` - Prevent usage of unsafe `target='_blank'` inside links, defaults to `true`
* `forms` - Prevent usage of unsafe `target='_blank'` inside forms, defaults to `false`

```json
"react/jsx-no-target-blank": [{"preventInForms": true}]
```

In this configuration, the following are considered errors:
When option `forms` is set to `true`, the following is considered an error:

```jsx
var Hello = <form target='_blank' action="http://example.com/"></form>
```

The following are **not** considered errors:
When option `links` is set to `true`, the following is considered an error:

```jsx
var Hello = <form target='_blank' rel='noopener noreferrer' action="http://example.com"></form>
var Hello = <a target='_blank' href="http://example.com/"></form>
```

## When Not To Use It
Expand Down

0 comments on commit 49895aa

Please sign in to comment.