Skip to content

Commit d800229

Browse files
committed
add missing prefix on option examples
1 parent 664c32b commit d800229

23 files changed

+39
-39
lines changed

docs/rules/display-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var Hello = React.createClass({
2929

3030
```js
3131
...
32-
"display-name": [<enabled>, { "ignoreTranspilerName": <boolean> }]
32+
"react/display-name": [<enabled>, { "ignoreTranspilerName": <boolean> }]
3333
...
3434
```
3535

docs/rules/forbid-component-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The following patterns are not considered warnings:
3535

3636
```js
3737
...
38-
"forbid-component-props": [<enabled>, { "forbid": [<string>] }]
38+
"react/forbid-component-props": [<enabled>, { "forbid": [<string>] }]
3939
...
4040
```
4141

docs/rules/jsx-closing-bracket-location.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ There are two ways to configure this rule.
3939
The first form is a string shortcut corresponding to the `location` values specified below. If omitted, it defaults to `"tag-aligned"`.
4040

4141
```js
42-
"jsx-closing-bracket-location": <enabled> // -> [<enabled>, "tag-aligned"]
43-
"jsx-closing-bracket-location": [<enabled>, "<location>"]
42+
"react/jsx-closing-bracket-location": <enabled> // -> [<enabled>, "tag-aligned"]
43+
"react/jsx-closing-bracket-location": [<enabled>, "<location>"]
4444
```
4545

4646
The second form allows you to distinguish between non-empty and self-closing tags. Both properties are optional, and both default to `"tag-aligned"`. You can also disable the rule for one particular type of tag by setting the value to `false`.
4747

4848
```js
49-
"jsx-closing-bracket-location": [<enabled>, {
49+
"react/jsx-closing-bracket-location": [<enabled>, {
5050
"nonEmpty": "<location>" || false,
5151
"selfClosing": "<location>" || false
5252
}]
@@ -71,7 +71,7 @@ The following patterns are considered warnings:
7171
// 'jsx-closing-bracket-location': 1
7272
// 'jsx-closing-bracket-location': [1, 'tag-aligned']
7373
// 'jsx-closing-bracket-location': [1, 'line-aligned']
74-
<Hello
74+
<Hello
7575
firstName="John"
7676
lastName="Smith"
7777
/>;
@@ -114,7 +114,7 @@ var x = function() {
114114
};
115115

116116
// 'jsx-closing-bracket-location': [1, 'after-props']
117-
<Hello
117+
<Hello
118118
firstName="John"
119119
lastName="Smith"
120120
/>;
@@ -127,7 +127,7 @@ var x = function() {
127127
</Say>;
128128

129129
// 'jsx-closing-bracket-location': [1, 'props-aligned']
130-
<Hello
130+
<Hello
131131
firstName="John"
132132
lastName="Smith" />;
133133

@@ -188,7 +188,7 @@ var x = function() {
188188
};
189189

190190
// 'jsx-closing-bracket-location': [1, {selfClosing: 'after-props'}]
191-
<Hello
191+
<Hello
192192
firstName="John"
193193
lastName="Smith" />;
194194

@@ -200,7 +200,7 @@ var x = function() {
200200
</Say>;
201201

202202
// 'jsx-closing-bracket-location': [1, {selfClosing: 'props-aligned', nonEmpty: 'after-props'}]
203-
<Hello
203+
<Hello
204204
firstName="John"
205205
lastName="Smith"
206206
/>;

docs/rules/jsx-filename-extension.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function MyComponent() {
2525
The set of allowed extensions is configurable. By default '.jsx' is allowed. If you wanted to allow both '.jsx' and '.js', the configuration would be:
2626

2727
```js
28-
"rules": {
29-
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
30-
}
28+
...
29+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
30+
...
3131
```
3232

3333
## When Not To Use It

docs/rules/jsx-handler-names.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following patterns are not considered warnings:
2828

2929
```js
3030
...
31-
"jsx-handler-names": [<enabled>, {
31+
"react/jsx-handler-names": [<enabled>, {
3232
"eventHandlerPrefix": <eventHandlerPrefix>,
3333
"eventHandlerPropPrefix": <eventHandlerPropPrefix>
3434
}]

docs/rules/jsx-indent-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ It takes an option as the second parameter which can be `"tab"` for tab-based in
3333

3434
```js
3535
...
36-
"jsx-indent-props": [<enabled>, 'tab'|<number>]
36+
"react/jsx-indent-props": [<enabled>, 'tab'|<number>]
3737
...
3838
```
3939

docs/rules/jsx-max-props-per-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The following patterns are not considered warnings:
3131

3232
```js
3333
...
34-
"jsx-max-props-per-line": [<enabled>, { "maximum": <number> }]
34+
"react/jsx-max-props-per-line": [<enabled>, { "maximum": <number> }]
3535
...
3636
```
3737

docs/rules/jsx-no-bind.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The following patterns are not considered warnings:
2121
## Rule Options
2222

2323
```js
24-
"jsx-no-bind": [<enabled>, {
24+
"react/jsx-no-bind": [<enabled>, {
2525
"ignoreRefs": <boolean> || false,
2626
"allowArrowFunctions": <boolean> || false,
2727
"allowBind": <boolean> || false

docs/rules/jsx-no-duplicate-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following patterns are not considered warnings:
2020

2121
```js
2222
...
23-
"jsx-no-duplicate-props": [<enabled>, { "ignoreCase": <boolean> }]
23+
"react/jsx-no-duplicate-props": [<enabled>, { "ignoreCase": <boolean> }]
2424
...
2525
```
2626

docs/rules/jsx-pascal-case.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following patterns are not considered warnings:
4040

4141
```js
4242
...
43-
"jsx-pascal-case": [<enabled>, { allowAllCaps: <allowAllCaps>, ignore: <ignore> }]
43+
"react/jsx-pascal-case": [<enabled>, { allowAllCaps: <allowAllCaps>, ignore: <ignore> }]
4444
...
4545
```
4646

docs/rules/jsx-sort-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following patterns are considered okay and do not cause warnings:
2323

2424
```js
2525
...
26-
"jsx-sort-props": [<enabled>, {
26+
"react/jsx-sort-props": [<enabled>, {
2727
"callbacksLast": <boolean>,
2828
"shorthandFirst": <boolean>,
2929
"shorthandLast": <boolean>,

docs/rules/no-did-mount-set-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var Hello = React.createClass({
5353

5454
```js
5555
...
56-
"no-did-mount-set-state": [<enabled>, <mode>]
56+
"react/no-did-mount-set-state": [<enabled>, <mode>]
5757
...
5858
```
5959

docs/rules/no-did-update-set-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var Hello = React.createClass({
5151

5252
```js
5353
...
54-
"no-did-update-set-state": [<enabled>, <mode>]
54+
"react/no-did-update-set-state": [<enabled>, <mode>]
5555
...
5656
```
5757

docs/rules/no-multi-comp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var HelloJohn = React.createClass({
3636

3737
```js
3838
...
39-
"no-multi-comp": [<enabled>, { "ignoreStateless": <boolean> }]
39+
"react/no-multi-comp": [<enabled>, { "ignoreStateless": <boolean> }]
4040
...
4141
```
4242

docs/rules/no-unknown-property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var Hello = <div className="hello">Hello World</div>;
2626

2727
```js
2828
...
29-
"no-unknown-property": [<enabled>, { ignore: <ignore> }]
29+
"react/no-unknown-property": [<enabled>, { ignore: <ignore> }]
3030
...
3131
```
3232

docs/rules/no-unused-prop-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ var Hello = React.createClass({
4545

4646
This rule can take one argument to ignore some specific props during validation.
4747

48-
```
48+
```js
4949
...
50-
"no-unused-prop-types": [<enabled>, { customValidators: <customValidator>, skipShapeProps: <skipShapeProps> }]
50+
"react/no-unused-prop-types": [<enabled>, { customValidators: <customValidator>, skipShapeProps: <skipShapeProps> }]
5151
...
5252
```
5353

docs/rules/prefer-stateless-function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Foo extends React.Component {
5454

5555
```js
5656
...
57-
"prefer-stateless-function": [<enabled>, { "ignorePureComponents": <ignorePureComponents> }]
57+
"react/prefer-stateless-function": [<enabled>, { "ignorePureComponents": <ignorePureComponents> }]
5858
...
5959
```
6060

docs/rules/prop-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ Hello.propTypes = {
100100

101101
This rule can take one argument to ignore some specific props during validation.
102102

103-
```
103+
```js
104104
...
105-
"prop-types": [<enabled>, { ignore: <ignore>, customValidators: <customValidator> }]
105+
"react/prop-types": [<enabled>, { ignore: <ignore>, customValidators: <customValidator> }]
106106
...
107107
```
108108

docs/rules/require-extension.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ var eslint = require('eslint');
3030
The set of forbidden extensions is configurable. By default '.jsx' is blocked. If you wanted to forbid both '.jsx' and '.js', the configuration would be:
3131

3232
```js
33-
"rules": {
34-
"react/require-extension": [1, { "extensions": [".js", ".jsx"] }],
35-
}
33+
...
34+
"react/require-extension": [1, { "extensions": [".js", ".jsx"] }],
35+
...
3636
```
3737

3838
To configure WebPack to resolve '.jsx' add the following to `webpack.config.js`:
3939

4040
```js
4141
resolve: {
42-
extensions: ["", ".js", ".jsx"]
43-
},
42+
extensions: ["", ".js", ".jsx"]
43+
},
4444
```
4545

4646
## When Not To Use It

docs/rules/require-optimization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ React.createClass({
5252

5353
```js
5454
...
55-
"require-optimization": [<enabled>, { allowDecorators: [<allowDecorator>] }]
55+
"react/require-optimization": [<enabled>, { allowDecorators: [<allowDecorator>] }]
5656
...
5757
```
5858

docs/rules/self-closing-comp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Prevent extra closing tags for components without children (self-closing-comp)
1+
# Prevent extra closing tags for components without children (react/self-closing-comp)
22

33
Components without children can be self-closed to avoid unnecessary extra closing tag.
44

@@ -32,7 +32,7 @@ The rule can take one argument to select types of tags, which should be self-clo
3232

3333
```js
3434
...
35-
"self-closing-comp": ["error", {
35+
"react/self-closing-comp": ["error", {
3636
"component": true,
3737
"html": true
3838
}]

docs/rules/sort-comp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var Hello = React.createClass({
3939

4040
This rule can take one argument to customize the components organisation.
4141

42-
```
42+
```js
4343
...
4444
"react/sort-comp": [<enabled>, { order: <order>, groups: <groups> }]
4545
...

docs/rules/sort-prop-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Component extends React.Component {
7676

7777
```js
7878
...
79-
"sort-prop-types": [<enabled>, {
79+
"react/sort-prop-types": [<enabled>, {
8080
"callbacksLast": <boolean>,
8181
"ignoreCase": <boolean>,
8282
"requiredFirst": <boolean>,

0 commit comments

Comments
 (0)