Skip to content

Commit 7b9fdb6

Browse files
author
Evgueni Naverniouk
committed
Merge branch 'master' into 226-unused-prop-types
# Conflicts: # README.md
2 parents 74f0cbe + ae5a43b commit 7b9fdb6

26 files changed

+672
-211
lines changed

.travis.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
language: node_js
22
node_js:
3-
- 0.10
4-
- 0.12
5-
- iojs
6-
- 4
7-
- 5
3+
- '6'
4+
- '5'
5+
- '4'
86
after_success:
97
- npm run coveralls

CHANGELOG.md

+83
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,89 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44
This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com).
55

6+
## [6.0.0-alpha.1] - 2016-07-08
7+
### Fixed
8+
* Fix `prop-types` crash when accessing constructor on props ([#654][])
9+
* Fix `jsx-filename-extension` to not check filenames on text input ([#662][] @ljharb)
10+
* Fix `no-comment-textnodes` incorrectly catching urls ([#664][] @petersendidit)
11+
12+
### Breaking
13+
* Add ESLint as peerDependency ([#657][] @jokeyrhyme)
14+
* Add Node.js 0.10 as minimum required version ([#657][] @jokeyrhyme)
15+
16+
### Changed
17+
* Update dependencies
18+
* Update Travis CI and AppVeyor CI configurations (@ljharb)
19+
20+
[6.0.0-alpha.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v5.2.2...v6.0.0-alpha.1
21+
[#654]: https://github.com/yannickcr/eslint-plugin-react/issues/654
22+
[#662]: https://github.com/yannickcr/eslint-plugin-react/issues/662
23+
[#664]: https://github.com/yannickcr/eslint-plugin-react/issues/664
24+
[#657]: https://github.com/yannickcr/eslint-plugin-react/pull/657
25+
26+
## [5.2.2] - 2016-06-17
27+
### Fixed
28+
* Fix `jsx-no-bind` crash ([#641][])
29+
30+
[5.2.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v5.2.1...v5.2.2
31+
[#641]: https://github.com/yannickcr/eslint-plugin-react/issues/641
32+
33+
## [5.2.1] - 2016-06-17
34+
### Fixed
35+
* Fix `jsx-pascal-case` for namespaced components ([#637][] @evcohen)
36+
37+
[5.2.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v5.2.0...v5.2.1
38+
[#637]: https://github.com/yannickcr/eslint-plugin-react/issues/637
39+
40+
## [5.2.0] - 2016-06-17
41+
### Added
42+
* Add `require-optimization` rule ([#240][] @EvNaverniouk)
43+
* Add `jsx-filename-extension` rule ([#495][] @lencioni)
44+
* Add `no-render-return-value` rule ([#531][] @iamdustan)
45+
* Add `no-comment-textnodes` rule ([#616][] @benvinegar)
46+
* Add `objectLiterals` option to `jsx-curly-spacing` ([#388][], [#211][] @casesandberg @ljharb)
47+
* Add option to `self-closing-comp` to check html tags ([#572][] @gitim)
48+
* Add `ignore` option to `no-unknown-property` rule ([#631][] @insin)
49+
* Add support for ES7 bind operator to `jsx-handler-names` ([#630][])
50+
* Add support for explicit declaration that class extends React.Component ([#68][] @gausie)
51+
52+
### Fixed
53+
* Fix `jsx-closing-bracket-location` multiline prop support ([#493][] @tuures)
54+
* Fix `prop-types` for props that where not assigned to the right component ([#591][])
55+
* Fix `display-name` when JSON style is used for defining components ([#590][] @gitim)
56+
* Fix `jsx-no-bind` for bind detection in render when assigned to a variable ([#474][] @petersendidit)
57+
* Fix `jsx-curly-spacing` for spread operator ([#606][] @gitim)
58+
* Fix `sort-comp` crash on spread operator ([#624][])
59+
* Fix `prop-types` crash when destructuring props with spread only
60+
61+
### Changed
62+
* Update dependencies
63+
* Add [doctrine](https://github.com/eslint/doctrine) as a dependency ([#68][] @gausie)
64+
* Add [jsx-ast-utils](https://github.com/evcohen/jsx-ast-utils) as a dependency ([#634][] @evcohen)
65+
* Documentation improvements ([#594][] @lencioni, [#598][] @mLuby, [#633][] @appsforartists)
66+
67+
[5.2.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v5.1.1...v5.2.0
68+
[#68]: https://github.com/yannickcr/eslint-plugin-react/issues/68
69+
[#211]: https://github.com/yannickcr/eslint-plugin-react/issues/211
70+
[#240]: https://github.com/yannickcr/eslint-plugin-react/issues/240
71+
[#388]: https://github.com/yannickcr/eslint-plugin-react/issues/388
72+
[#474]: https://github.com/yannickcr/eslint-plugin-react/issues/474
73+
[#493]: https://github.com/yannickcr/eslint-plugin-react/pull/493
74+
[#495]: https://github.com/yannickcr/eslint-plugin-react/issues/495
75+
[#531]: https://github.com/yannickcr/eslint-plugin-react/issues/531
76+
[#572]: https://github.com/yannickcr/eslint-plugin-react/issues/572
77+
[#590]: https://github.com/yannickcr/eslint-plugin-react/issues/590
78+
[#591]: https://github.com/yannickcr/eslint-plugin-react/issues/591
79+
[#594]: https://github.com/yannickcr/eslint-plugin-react/pull/594
80+
[#598]: https://github.com/yannickcr/eslint-plugin-react/pull/598
81+
[#606]: https://github.com/yannickcr/eslint-plugin-react/issues/606
82+
[#616]: https://github.com/yannickcr/eslint-plugin-react/pull/616
83+
[#624]: https://github.com/yannickcr/eslint-plugin-react/issues/624
84+
[#630]: https://github.com/yannickcr/eslint-plugin-react/issues/630
85+
[#631]: https://github.com/yannickcr/eslint-plugin-react/pull/631
86+
[#633]: https://github.com/yannickcr/eslint-plugin-react/pull/633
87+
[#634]: https://github.com/yannickcr/eslint-plugin-react/pull/634
88+
689
## [5.1.1] - 2016-05-10
790
### Fixed
891
* Fix `require-render-return` crash ([#589][])

README.md

+68-62
Original file line numberDiff line numberDiff line change
@@ -68,61 +68,67 @@ With ESLint 2.x.x:
6868
}
6969
```
7070

71-
Finally, enable all of the rules that you would like to use.
71+
Finally, enable all of the rules that you would like to use. Use [our preset](#user-content-recommended-configuration) to get reasonable defaults quickly, and/or choose your own:
7272

73-
The plugin has a [recommended configuration](#user-content-recommended-configuration) that enforces React good practices.
73+
```json
74+
"rules": {
75+
"react/jsx-uses-react": "error",
76+
"react/jsx-uses-vars": "error",
77+
}
78+
```
7479

7580
# List of supported rules
7681

77-
* [display-name](docs/rules/display-name.md): Prevent missing `displayName` in a React component definition
78-
* [forbid-prop-types](docs/rules/forbid-prop-types.md): Forbid certain propTypes
79-
* [no-danger](docs/rules/no-danger.md): Prevent usage of dangerous JSX properties
80-
* [no-deprecated](docs/rules/no-deprecated.md): Prevent usage of deprecated methods
81-
* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of `setState` in `componentDidMount`
82-
* [no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of `setState` in `componentDidUpdate`
83-
* [no-direct-mutation-state](docs/rules/no-direct-mutation-state.md): Prevent direct mutation of `this.state`
84-
* [no-is-mounted](docs/rules/no-is-mounted.md): Prevent usage of `isMounted`
85-
* [no-multi-comp](docs/rules/no-multi-comp.md): Prevent multiple component definition per file
86-
* [no-render-return-value](docs/rules/no-render-return-value.md): Prevent usage of the return value of `React.render`
87-
* [no-set-state](docs/rules/no-set-state.md): Prevent usage of `setState`
88-
* [no-string-refs](docs/rules/no-string-refs.md): Prevent using string references in `ref` attribute.
89-
* [no-unknown-property](docs/rules/no-unknown-property.md): Prevent usage of unknown DOM property (fixable)
90-
* [prefer-es6-class](docs/rules/prefer-es6-class.md): Enforce ES5 or ES6 class for React Components
91-
* [prefer-stateless-function](docs/rules/prefer-stateless-function.md): Enforce stateless React Components to be written as a pure function
92-
* [prop-types](docs/rules/prop-types.md): Prevent missing props validation in a React component definition
93-
* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing `React` when using JSX
94-
* [require-extension](docs/rules/require-extension.md): Restrict file extensions that may be required
95-
* [require-optimization](docs/rules/require-optimization.md): Enforce React components to have a shouldComponentUpdate method
96-
* [require-render-return](docs/rules/require-render-return.md): Enforce ES5 or ES6 class for returning value in render function
97-
* [self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children
98-
* [sort-comp](docs/rules/sort-comp.md): Enforce component methods order
99-
* [sort-prop-types](docs/rules/sort-prop-types.md): Enforce propTypes declarations alphabetical sorting
100-
* [unused-prop-types](docs/rules/unused-prop-types.md): Prevent definitions of unused prop types
101-
* [wrap-multilines](docs/rules/wrap-multilines.md): Prevent missing parentheses around multilines JSX (fixable)
82+
* [react/display-name](docs/rules/display-name.md): Prevent missing `displayName` in a React component definition
83+
* [react/forbid-prop-types](docs/rules/forbid-prop-types.md): Forbid certain propTypes
84+
* [react/no-comment-textnodes](docs/rules/no-comment-textnodes.md): Prevent comments from being inserted as text nodes
85+
* [react/no-danger](docs/rules/no-danger.md): Prevent usage of dangerous JSX properties
86+
* [react/no-deprecated](docs/rules/no-deprecated.md): Prevent usage of deprecated methods
87+
* [react/no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of `setState` in `componentDidMount`
88+
* [react/no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of `setState` in `componentDidUpdate`
89+
* [react/no-direct-mutation-state](docs/rules/no-direct-mutation-state.md): Prevent direct mutation of `this.state`
90+
* [react/no-is-mounted](docs/rules/no-is-mounted.md): Prevent usage of `isMounted`
91+
* [react/no-multi-comp](docs/rules/no-multi-comp.md): Prevent multiple component definition per file
92+
* [react/no-render-return-value](docs/rules/no-render-return-value.md): Prevent usage of the return value of `React.render`
93+
* [react/no-set-state](docs/rules/no-set-state.md): Prevent usage of `setState`
94+
* [react/no-string-refs](docs/rules/no-string-refs.md): Prevent using string references in `ref` attribute.
95+
* [react/no-unknown-property](docs/rules/no-unknown-property.md): Prevent usage of unknown DOM property (fixable)
96+
* [react/prefer-es6-class](docs/rules/prefer-es6-class.md): Enforce ES5 or ES6 class for React Components
97+
* [react/prefer-stateless-function](docs/rules/prefer-stateless-function.md): Enforce stateless React Components to be written as a pure function
98+
* [react/prop-types](docs/rules/prop-types.md): Prevent missing props validation in a React component definition
99+
* [react/react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing `React` when using JSX
100+
* [react/require-extension](docs/rules/require-extension.md): Restrict file extensions that may be required
101+
* [react/require-optimization](docs/rules/require-optimization.md): Enforce React components to have a shouldComponentUpdate method
102+
* [react/require-render-return](docs/rules/require-render-return.md): Enforce ES5 or ES6 class for returning value in render function
103+
* [react/self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children
104+
* [react/sort-comp](docs/rules/sort-comp.md): Enforce component methods order
105+
* [react/sort-prop-types](docs/rules/sort-prop-types.md): Enforce propTypes declarations alphabetical sorting
106+
* [react/unused-prop-types](docs/rules/unused-prop-types.md): Prevent definitions of unused prop types
107+
* [react/wrap-multilines](docs/rules/wrap-multilines.md): Prevent missing parentheses around multilines JSX (fixable)
102108

103109
## JSX-specific rules
104110

105-
* [jsx-boolean-value](docs/rules/jsx-boolean-value.md): Enforce boolean attributes notation in JSX (fixable)
106-
* [jsx-closing-bracket-location](docs/rules/jsx-closing-bracket-location.md): Validate closing bracket location in JSX (fixable)
107-
* [jsx-curly-spacing](docs/rules/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes (fixable)
108-
* [jsx-equals-spacing](docs/rules/jsx-equals-spacing.md): Enforce or disallow spaces around equal signs in JSX attributes (fixable)
109-
* [jsx-filename-extension](docs/rules/jsx-filename-extension.md): Restrict file extensions that may contain JSX
110-
* [jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md): Enforce position of the first prop in JSX
111-
* [jsx-handler-names](docs/rules/jsx-handler-names.md): Enforce event handler naming conventions in JSX
112-
* [jsx-indent](docs/rules/jsx-indent.md): Validate JSX indentation
113-
* [jsx-indent-props](docs/rules/jsx-indent-props.md): Validate props indentation in JSX (fixable)
114-
* [jsx-key](docs/rules/jsx-key.md): Validate JSX has key prop when in array or iterator
115-
* [jsx-max-props-per-line](docs/rules/jsx-max-props-per-line.md): Limit maximum of props on a single line in JSX
116-
* [jsx-no-bind](docs/rules/jsx-no-bind.md): Prevent usage of `.bind()` and arrow functions in JSX props
117-
* [jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md): Prevent duplicate props in JSX
118-
* [jsx-no-literals](docs/rules/jsx-no-literals.md): Prevent usage of unwrapped JSX strings
119-
* [jsx-no-target-blank](docs/rules/jsx-no-target-blank.md): Prevent usage of unsafe `target='_blank'`
120-
* [jsx-no-undef](docs/rules/jsx-no-undef.md): Disallow undeclared variables in JSX
121-
* [jsx-pascal-case](docs/rules/jsx-pascal-case.md): Enforce PascalCase for user-defined JSX components
122-
* [jsx-sort-props](docs/rules/jsx-sort-props.md): Enforce props alphabetical sorting
123-
* [jsx-space-before-closing](docs/rules/jsx-space-before-closing.md): Validate spacing before closing bracket in JSX (fixable)
124-
* [jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused
125-
* [jsx-uses-vars](docs/rules/jsx-uses-vars.md): Prevent variables used in JSX to be incorrectly marked as unused
111+
* [react/jsx-boolean-value](docs/rules/jsx-boolean-value.md): Enforce boolean attributes notation in JSX (fixable)
112+
* [react/jsx-closing-bracket-location](docs/rules/jsx-closing-bracket-location.md): Validate closing bracket location in JSX (fixable)
113+
* [react/jsx-curly-spacing](docs/rules/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes (fixable)
114+
* [react/jsx-equals-spacing](docs/rules/jsx-equals-spacing.md): Enforce or disallow spaces around equal signs in JSX attributes (fixable)
115+
* [react/jsx-filename-extension](docs/rules/jsx-filename-extension.md): Restrict file extensions that may contain JSX
116+
* [react/jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md): Enforce position of the first prop in JSX
117+
* [react/jsx-handler-names](docs/rules/jsx-handler-names.md): Enforce event handler naming conventions in JSX
118+
* [react/jsx-indent](docs/rules/jsx-indent.md): Validate JSX indentation
119+
* [react/jsx-indent-props](docs/rules/jsx-indent-props.md): Validate props indentation in JSX (fixable)
120+
* [react/jsx-key](docs/rules/jsx-key.md): Validate JSX has key prop when in array or iterator
121+
* [react/jsx-max-props-per-line](docs/rules/jsx-max-props-per-line.md): Limit maximum of props on a single line in JSX
122+
* [react/jsx-no-bind](docs/rules/jsx-no-bind.md): Prevent usage of `.bind()` and arrow functions in JSX props
123+
* [react/jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md): Prevent duplicate props in JSX
124+
* [react/jsx-no-literals](docs/rules/jsx-no-literals.md): Prevent usage of unwrapped JSX strings
125+
* [react/jsx-no-target-blank](docs/rules/jsx-no-target-blank.md): Prevent usage of unsafe `target='_blank'`
126+
* [react/jsx-no-undef](docs/rules/jsx-no-undef.md): Disallow undeclared variables in JSX
127+
* [react/jsx-pascal-case](docs/rules/jsx-pascal-case.md): Enforce PascalCase for user-defined JSX components
128+
* [react/jsx-sort-props](docs/rules/jsx-sort-props.md): Enforce props alphabetical sorting
129+
* [react/jsx-space-before-closing](docs/rules/jsx-space-before-closing.md): Validate spacing before closing bracket in JSX (fixable)
130+
* [react/jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused
131+
* [react/jsx-uses-vars](docs/rules/jsx-uses-vars.md): Prevent variables used in JSX to be incorrectly marked as unused
126132

127133
## React Native rules
128134

@@ -147,20 +153,20 @@ See [ESLint documentation](http://eslint.org/docs/user-guide/configuring#extendi
147153

148154
The rules enabled in this configuration are:
149155

150-
* [display-name](docs/rules/display-name.md)
151-
* [jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md)
152-
* [jsx-no-undef](docs/rules/jsx-no-undef.md)
153-
* [jsx-uses-react](docs/rules/jsx-uses-react.md)
154-
* [jsx-uses-vars](docs/rules/jsx-uses-vars.md)
155-
* [no-danger](docs/rules/no-danger.md)
156-
* [no-deprecated](docs/rules/no-deprecated.md)
157-
* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md) with `allow-in-func` option
158-
* [no-did-update-set-state](docs/rules/no-did-update-set-state.md) with `allow-in-func` option
159-
* [no-direct-mutation-state](docs/rules/no-direct-mutation-state.md)
160-
* [no-is-mounted](docs/rules/no-is-mounted.md)
161-
* [no-unknown-property](docs/rules/no-unknown-property.md)
162-
* [prop-types](docs/rules/prop-types.md)
163-
* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md)
156+
* [react/display-name](docs/rules/display-name.md)
157+
* [react/jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md)
158+
* [react/jsx-no-undef](docs/rules/jsx-no-undef.md)
159+
* [react/jsx-uses-react](docs/rules/jsx-uses-react.md)
160+
* [react/jsx-uses-vars](docs/rules/jsx-uses-vars.md)
161+
* [react/no-danger](docs/rules/no-danger.md)
162+
* [react/no-deprecated](docs/rules/no-deprecated.md)
163+
* [react/no-did-mount-set-state](docs/rules/no-did-mount-set-state.md) with `allow-in-func` option
164+
* [react/no-did-update-set-state](docs/rules/no-did-update-set-state.md) with `allow-in-func` option
165+
* [react/no-direct-mutation-state](docs/rules/no-direct-mutation-state.md)
166+
* [react/no-is-mounted](docs/rules/no-is-mounted.md)
167+
* [react/no-unknown-property](docs/rules/no-unknown-property.md)
168+
* [react/prop-types](docs/rules/prop-types.md)
169+
* [react/react-in-jsx-scope](docs/rules/react-in-jsx-scope.md)
164170

165171
**Note**: This configuration will also enable JSX in [parser options](http://eslint.org/docs/user-guide/configuring#specifying-parser-options).
166172

appveyor.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
environment:
22
matrix:
3-
- nodejs_version: '0.10'
4-
- nodejs_version: '0.12'
5-
- nodejs_version: '3'
63
- nodejs_version: '4'
74
- nodejs_version: '5'
5+
- nodejs_version: '6'
86
install:
97
- ps: Install-Product node $env:nodejs_version
108
- set CI=true

docs/rules/jsx-curly-spacing.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,34 @@ The following patterns are not warnings:
107107
<Hello name={ {firstname: 'John', lastname: 'Doe'} } />;
108108
```
109109

110-
#### Alternative
110+
#### Granular spacing controls
111111

112-
When setting the `alternative` option to `true` you must collapse the curly braces:
112+
You can specify an additional `spacing` property that is an object with the following possible values:
113113

114114
```json
115-
"jsx-curly-spacing": [2, "always", {"alternative": true}]
115+
"jsx-curly-spacing": [2, "always", {"spacing": {
116+
"objectLiterals": "never"
117+
}}]
116118
```
117119

118-
When `"always"` is used and `alternative` is `true`, the following pattern is not warnings:
120+
* `objectLiterals`: This controls different spacing requirements when the value inside the jsx curly braces is an object literal.
121+
122+
All spacing options accept either the string `"always"` or the string `"never"`. Note that the default value for all "spacing" options matches the first "always"/"never" option provided.
123+
124+
When `"always"` is used but `objectLiterals` is `"never"`, the following pattern is not considered a warning:
119125

120126
```js
121-
<App foo={{ bar: true, baz: true }} />;
127+
<App blah={ 3 } foo={{ bar: true, baz: true }} />;
122128
```
123129

124-
When `"always"` is used and `alternative` is `true`, the following pattern is considered warnings:
130+
When `"never"` is used and `objectLiterals` is `"always"`, the following pattern is not considered a warning:
125131

126132
```js
127-
<App foo={ {bar: true, baz: true} } />;
133+
<App blah={3} foo={ {bar: true, baz: true} } />;
128134
```
129135

136+
Please note that spacing of the object literal curly braces themselves is controlled by the built-in [`object-curly-spacing`](http://eslint.org/docs/rules/object-curly-spacing) rule.
137+
130138
## When Not To Use It
131139

132140
You can turn this rule off if you are not concerned with the consistency around the spacing inside of JSX attributes.

docs/rules/no-unknown-property.md

+11
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ var React = require('react');
2222
var Hello = <div className="hello">Hello World</div>;
2323
```
2424

25+
## Rule Options
26+
27+
```js
28+
...
29+
"no-unknown-property": [<enabled>, { ignore: <ignore> }]
30+
...
31+
```
32+
33+
* `enabled`: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.
34+
* `ignore`: optional array of property and attribute names to ignore during validation.
35+
2536
## When Not To Use It
2637

2738
If you are not using JSX you can disable this rule.

0 commit comments

Comments
 (0)