Skip to content

Commit a0d2f5d

Browse files
ocavueljharb
andauthored
Update lib/rules/jsx-fragments.js
Co-authored-by: Jordan Harband <[email protected]>
1 parent b4e0498 commit a0d2f5d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rules/jsx-fragments.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ module.exports = {
170170
ImportDeclaration(node) {
171171
if (node.source && node.source.value === 'react') {
172172
node.specifiers.forEach((spec) => {
173-
if ('imported' in spec && spec.imported && 'name' in spec.imported && spec.imported.name === fragmentPragma) {
173+
if (
174+
'imported' in spec
175+
&& spec.imported
176+
&& 'name' in spec.imported
177+
&& spec.imported.name === fragmentPragma
178+
) {
174179
if (spec.local) {
175180
fragmentNames.add(spec.local.name);
176181
}

0 commit comments

Comments
 (0)