We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8ee193 commit 7def79fCopy full SHA for 7def79f
lib/rules/jsx-child-element-spacing.js
@@ -1,6 +1,7 @@
1
'use strict';
2
3
-const INLINE_ELEMENTS = [
+// This list is taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
4
+const INLINE_ELEMENTS = new Set([
5
'a',
6
'abbr',
7
'acronym',
@@ -32,7 +33,7 @@ const INLINE_ELEMENTS = [
32
33
'textarea',
34
'tt',
35
'var'
-];
36
+]);
37
38
module.exports = {
39
meta: {
@@ -61,7 +62,7 @@ module.exports = {
61
62
63
const isInlineElement = node => (
64
node.type === 'JSXElement' &&
- INLINE_ELEMENTS.indexOf(elementName(node)) !== -1
65
+ INLINE_ELEMENTS.has(elementName(node))
66
);
67
68
const TEXT_FOLLOWING_ELEMENT_PATTERN = /^\s*\n\s*\S/;
0 commit comments