Skip to content

Commit 10f66c4

Browse files
committed
Update documentation
1 parent 5df82bd commit 10f66c4

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Finally, enable all of the rules that you would like to use.
6464
* [self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children
6565
* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of setState in componentDidMount
6666
* [no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of setState in componentDidUpdate
67-
* [jsx-uses-react](docs/rules/jsx-uses-react.md): Make JSX count towards use of a declared variable
68-
* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent errors from not requiring React when using JSX
67+
* [jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused
68+
* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing React when using JSX
6969

7070
## To Do
7171

docs/rules/jsx-uses-react.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Make JSX count towards use of a declared variable (jsx-uses-react)
1+
# Prevent React to be incorrectly marked as unused (jsx-uses-react)
22

33
JSX expands to a call to `React.createElement`, a file which includes `React`
4-
but only uses JSX should still consider the `React` variable used.
4+
but only uses JSX should consider the `React` variable as used.
55

66
This rule has no effect if the `no-unused-vars` rule is not enabled.
77

@@ -25,5 +25,4 @@ var elem = <div>Some Stuff</div>;
2525

2626
## When Not To Use It
2727

28-
If you are not using JSX, or React is delcared as global variable, this rule
29-
will not be useful.
28+
If you are not using JSX, if React is declared as global variable or if you do not use the `no-unused-vars` rule then you can disable this rule.

docs/rules/react-in-jsx-scope.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Prevent errors from not requiring React when using JSX (react-in-jsx-scope)
1+
# Prevent missing React when using JSX (react-in-jsx-scope)
22

33
When using JSX, `<a />` expands to `React.createElement("a")`. Therefore the
44
`React` variable must be in scope.
@@ -20,4 +20,4 @@ var Hello = <div>Hello {this.props.name}</div>;
2020

2121
## When Not To Use It
2222

23-
If you are setting `React` as a global variable, you will not need this rule.
23+
If you are setting `React` as a global variable you can disable this rule.

lib/rules/jsx-uses-react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @fileoverview Count <Jsx /> as use of the React variable
2+
* @fileoverview Prevent React to be marked as unused
33
* @author Glen Mailer
44
*/
55
'use strict';

lib/rules/react-in-jsx-scope.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @fileoverview Validate that React is in scope when using JSX.
2+
* @fileoverview Prevent missing React when using JSX
33
* @author Glen Mailer
44
*/
55
'use strict';

0 commit comments

Comments
 (0)