Skip to content

Commit

Permalink
Fix default configuration for jsx-boolean-value rule (fixes #210)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Sep 9, 2015
1 parent f981bf2 commit ae15a67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/jsx-boolean-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

module.exports = function(context) {

var configuration = context.options[0] || {};
var configuration = context.options[0] || 'never';

var NEVER_MESSAGE = 'Value must be omitted for boolean attributes';
var ALWAYS_MESSAGE = 'Value must be set for boolean attributes';
Expand Down
3 changes: 3 additions & 0 deletions tests/lib/rules/jsx-boolean-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ var ruleTester = new RuleTester();
ruleTester.run('jsx-boolean-value', rule, {
valid: [
{code: '<App foo />;', options: ['never'], ecmaFeatures: {jsx: true}},
{code: '<App foo />;', ecmaFeatures: {jsx: true}},
{code: '<App foo={true} />;', options: ['always'], ecmaFeatures: {jsx: true}}
],
invalid: [
{code: '<App foo={true} />;', options: ['never'],
errors: [{message: 'Value must be omitted for boolean attributes'}], ecmaFeatures: {jsx: true}},
{code: '<App foo={true} />;',
errors: [{message: 'Value must be omitted for boolean attributes'}], ecmaFeatures: {jsx: true}},
{code: '<App foo />;', options: ['always'],
errors: [{message: 'Value must be set for boolean attributes'}], ecmaFeatures: {jsx: true}}
]
Expand Down

0 comments on commit ae15a67

Please sign in to comment.