Skip to content

Commit 7def79f

Browse files
committed
Review comments
1 parent c8ee193 commit 7def79f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/rules/jsx-child-element-spacing.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
const INLINE_ELEMENTS = [
3+
// This list is taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
4+
const INLINE_ELEMENTS = new Set([
45
'a',
56
'abbr',
67
'acronym',
@@ -32,7 +33,7 @@ const INLINE_ELEMENTS = [
3233
'textarea',
3334
'tt',
3435
'var'
35-
];
36+
]);
3637

3738
module.exports = {
3839
meta: {
@@ -61,7 +62,7 @@ module.exports = {
6162

6263
const isInlineElement = node => (
6364
node.type === 'JSXElement' &&
64-
INLINE_ELEMENTS.indexOf(elementName(node)) !== -1
65+
INLINE_ELEMENTS.has(elementName(node))
6566
);
6667

6768
const TEXT_FOLLOWING_ELEMENT_PATTERN = /^\s*\n\s*\S/;

0 commit comments

Comments
 (0)