Skip to content

Commit b0e4c84

Browse files
committed
Merge branch 'master' into lukyth/state-in-constructor
2 parents b1024c0 + 8f2663e commit b0e4c84

File tree

76 files changed

+3329
-2407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3329
-2407
lines changed

docs/rules/display-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var Hello = createReactClass({
3333
...
3434
```
3535

36-
### `ignoreTranspilerName`
36+
### `ignoreTranspilerName` (default: `false`)
3737

3838
When `true` the rule will ignore the name set by the transpiler and require a `displayName` property in this case.
3939

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ This rules requires that you accompany `target='_blank'` attributes with `rel='n
88

99
## Rule Details
1010

11-
This rule aims to prevent user generated links from creating security vulerabilities by requiring
11+
This rule aims to prevent user generated links from creating security vulnerabilities by requiring
1212
`rel='noreferrer noopener'` for external links, and optionally any dynamically generated links.
1313

1414
## Rule Options
15+
```json
16+
...
17+
"react/jsx-no-target-blank": [<enabled>, { "enforceDynamicLinks": <enforce> }]
18+
...
19+
```
1520

16-
There are two main options for the rule:
17-
18-
* `{"enforceDynamicLinks": "always"}` enforces the rule if the href is a dynamic link (default)
19-
* `{"enforceDynamicLinks": "never"}` does not enforce the rule if the href is a dynamic link
20-
21+
* enabled: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.
22+
* enforce: optional string, 'always' or 'never'
2123

2224
### always (default)
25+
`{"enforceDynamicLinks": "always"}` enforces the rule if the href is a dynamic link (default)
2326

2427
When {"enforceDynamicLinks": "always"} is set, the following patterns are considered errors:
2528

@@ -40,6 +43,8 @@ var Hello = <a></a>
4043

4144
### never
4245

46+
`{"enforceDynamicLinks": "never"}` does not enforce the rule if the href is a dynamic link
47+
4348
When {"enforceDynamicLinks": "never"} is set, the following patterns are **not** considered errors:
4449

4550
```jsx
@@ -48,4 +53,4 @@ var Hello = <a target='_blank' href={ dynamicLink }></a>
4853

4954
## When Not To Use It
5055

51-
If you do not have any external links, you can disable this rule
56+
If you do not have any external links, you can disable this rule

lib/rules/boolean-prop-naming.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
'use strict';
66

7-
const has = require('has');
87
const Components = require('../util/Components');
98
const propsUtil = require('../util/props');
109
const docsUrl = require('../util/docsUrl');
@@ -248,7 +247,7 @@ module.exports = {
248247
}
249248
}
250249

251-
if (!has(list, component) || (list[component].invalidProps || []).length) {
250+
if (list[component].invalidProps && list[component].invalidProps.length > 0) {
252251
reportInvalidNaming(list[component]);
253252
}
254253
});

0 commit comments

Comments
 (0)