Skip to content

Commit 581d1fe

Browse files
committed
Fix default configuration for jsx-boolean-value (fixes jsx-eslint#210)
1 parent f981bf2 commit 581d1fe

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1010

1111
### Fixed
1212
* Fix allowed methods on arrayOf in `prop-types` ([#146][])
13+
* Fix default configuration for `jsx-boolean-value` ([#210][])
1314

1415
[Unreleased]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.3.1...HEAD
1516
[#146]: https://github.com/yannickcr/eslint-plugin-react/issues/146
1617
[#197]: https://github.com/yannickcr/eslint-plugin-react/pull/197
1718
[#206]: https://github.com/yannickcr/eslint-plugin-react/pull/206
19+
[#210]: https://github.com/yannickcr/eslint-plugin-react/issues/210
1820

1921
## [3.3.1] - 2015-09-01
2022
### Changed

lib/rules/jsx-boolean-value.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
module.exports = function(context) {
1212

13-
var configuration = context.options[0] || {};
13+
var configuration = context.options[0] || 'never';
1414

1515
var NEVER_MESSAGE = 'Value must be omitted for boolean attributes';
1616
var ALWAYS_MESSAGE = 'Value must be set for boolean attributes';

tests/lib/rules/jsx-boolean-value.js

+3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ var ruleTester = new RuleTester();
1919
ruleTester.run('jsx-boolean-value', rule, {
2020
valid: [
2121
{code: '<App foo />;', options: ['never'], ecmaFeatures: {jsx: true}},
22+
{code: '<App foo />;', ecmaFeatures: {jsx: true}},
2223
{code: '<App foo={true} />;', options: ['always'], ecmaFeatures: {jsx: true}}
2324
],
2425
invalid: [
2526
{code: '<App foo={true} />;', options: ['never'],
2627
errors: [{message: 'Value must be omitted for boolean attributes'}], ecmaFeatures: {jsx: true}},
28+
{code: '<App foo={true} />;',
29+
errors: [{message: 'Value must be omitted for boolean attributes'}], ecmaFeatures: {jsx: true}},
2730
{code: '<App foo />;', options: ['always'],
2831
errors: [{message: 'Value must be set for boolean attributes'}], ecmaFeatures: {jsx: true}}
2932
]

0 commit comments

Comments
 (0)