Skip to content

Commit d59ac20

Browse files
committed
Remove unnecessary type narrowing
1 parent b6856ed commit d59ac20

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

lib/rules/jsx-sort-default-props.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ module.exports = {
173173
return;
174174
}
175175

176-
if (
177-
node.parent.type !== 'BinaryExpression'
178-
&& node.parent.type !== 'AssignmentExpression'
179-
&& node.parent.type !== 'LogicalExpression'
180-
) {
176+
if (node.parent.type !== 'AssignmentExpression') {
181177
return;
182178
}
183179

lib/rules/jsx-space-before-closing.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,7 @@ module.exports = {
6464
return;
6565
}
6666

67-
if (
68-
closingSlash.type !== 'Boolean'
69-
&& closingSlash.type !== 'Null'
70-
&& closingSlash.type !== 'Identifier'
71-
&& closingSlash.type !== 'Keyword'
72-
&& closingSlash.type !== 'Punctuator'
73-
&& closingSlash.type !== 'JSXIdentifier'
74-
&& closingSlash.type !== 'JSXText'
75-
&& closingSlash.type !== 'Numeric'
76-
&& closingSlash.type !== 'String'
77-
&& closingSlash.type !== 'RegularExpression'
78-
) {
67+
if (closingSlash.type !== 'Punctuator') {
7968
return;
8069
}
8170

0 commit comments

Comments
 (0)