diff --git a/lib/rules/jsx-child-element-spacing.js b/lib/rules/jsx-child-element-spacing.js index f2bfa60483..fd0510cc6c 100644 --- a/lib/rules/jsx-child-element-spacing.js +++ b/lib/rules/jsx-child-element-spacing.js @@ -3,6 +3,9 @@ const docsUrl = require('../util/docsUrl'); // This list is taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements + +// Note: 'br' is not included because whitespace around br tags is +// inconsequential to the rendered output const INLINE_ELEMENTS = new Set([ 'a', 'abbr', @@ -10,7 +13,6 @@ const INLINE_ELEMENTS = new Set([ 'b', 'bdo', 'big', - 'br', 'button', 'cite', 'code', diff --git a/tests/lib/rules/jsx-child-element-spacing.js b/tests/lib/rules/jsx-child-element-spacing.js index 4567ef11b1..025bef1afd 100644 --- a/tests/lib/rules/jsx-child-element-spacing.js +++ b/tests/lib/rules/jsx-child-element-spacing.js @@ -139,6 +139,31 @@ ruleTester.run('jsx-child-element-spacing', rule, { B ` + }, { + code: ` + + A +
+ B +
+ ` + }, { + code: ` + + A
+ B +
+ ` + }, { + code: ` + + A
B +
+ ` + }, { + code: ` + A
B
+ ` }], invalid: [{