Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Mar 2, 2015
1 parent 5df82bd commit 10f66c4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Finally, enable all of the rules that you would like to use.
* [self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children
* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of setState in componentDidMount
* [no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of setState in componentDidUpdate
* [jsx-uses-react](docs/rules/jsx-uses-react.md): Make JSX count towards use of a declared variable
* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent errors from not requiring React when using JSX
* [jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused
* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing React when using JSX

## To Do

Expand Down
7 changes: 3 additions & 4 deletions docs/rules/jsx-uses-react.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Make JSX count towards use of a declared variable (jsx-uses-react)
# Prevent React to be incorrectly marked as unused (jsx-uses-react)

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

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

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

## When Not To Use It

If you are not using JSX, or React is delcared as global variable, this rule
will not be useful.
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.
4 changes: 2 additions & 2 deletions docs/rules/react-in-jsx-scope.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prevent errors from not requiring React when using JSX (react-in-jsx-scope)
# Prevent missing React when using JSX (react-in-jsx-scope)

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

## When Not To Use It

If you are setting `React` as a global variable, you will not need this rule.
If you are setting `React` as a global variable you can disable this rule.
2 changes: 1 addition & 1 deletion lib/rules/jsx-uses-react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @fileoverview Count <Jsx /> as use of the React variable
* @fileoverview Prevent React to be marked as unused
* @author Glen Mailer
*/
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/react-in-jsx-scope.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @fileoverview Validate that React is in scope when using JSX.
* @fileoverview Prevent missing React when using JSX
* @author Glen Mailer
*/
'use strict';
Expand Down

0 comments on commit 10f66c4

Please sign in to comment.