Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pfhayes committed Nov 22, 2017
1 parent c8ee193 commit 7def79f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rules/jsx-child-element-spacing.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const INLINE_ELEMENTS = [
// This list is taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
const INLINE_ELEMENTS = new Set([
'a',
'abbr',
'acronym',
Expand Down Expand Up @@ -32,7 +33,7 @@ const INLINE_ELEMENTS = [
'textarea',
'tt',
'var'
];
]);

module.exports = {
meta: {
Expand Down Expand Up @@ -61,7 +62,7 @@ module.exports = {

const isInlineElement = node => (
node.type === 'JSXElement' &&
INLINE_ELEMENTS.indexOf(elementName(node)) !== -1
INLINE_ELEMENTS.has(elementName(node))
);

const TEXT_FOLLOWING_ELEMENT_PATTERN = /^\s*\n\s*\S/;
Expand Down

0 comments on commit 7def79f

Please sign in to comment.