diff --git a/lib/rules/jsx-boolean-value.js b/lib/rules/jsx-boolean-value.js index 1cff171147..4572e7ff8d 100644 --- a/lib/rules/jsx-boolean-value.js +++ b/lib/rules/jsx-boolean-value.js @@ -132,7 +132,6 @@ module.exports = { } if ( isNever(configuration, exceptions, propName) - && !configObject.assumeUndefinedIsFalse && value && value.type === 'JSXExpressionContainer' && value.expression.value === true diff --git a/tests/lib/rules/jsx-boolean-value.js b/tests/lib/rules/jsx-boolean-value.js index e8cbbb3e7f..f4216f2ce1 100644 --- a/tests/lib/rules/jsx-boolean-value.js +++ b/tests/lib/rules/jsx-boolean-value.js @@ -52,6 +52,10 @@ ruleTester.run('jsx-boolean-value', rule, { code: ';', options: ['never', { assumeUndefinedIsFalse: true }], }, + { + code: ';', + options: ['never', { assumeUndefinedIsFalse: false }], + }, { code: ';', options: ['never', { assumeUndefinedIsFalse: true, always: ['foo'] }], @@ -145,6 +149,21 @@ ruleTester.run('jsx-boolean-value', rule, { }, ], }, + { + code: ';', + output: ';', + options: ['never', { assumeUndefinedIsFalse: true }], + errors: [ + { + messageId: 'omitBoolean', + data: { propName: 'foo' }, + }, + { + messageId: 'omitPropAndBoolean', + data: { propName: 'bak' }, + }, + ], + }, { code: ';', output: ';',