Skip to content

Commit f33003c

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

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rules/jsx-fragments.js

+6-1
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)