File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
packages/eslint-plugin/src/rules Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,13 @@ export default createRule<[], MessageId>({
51
51
'UnaryExpression[operator="delete"]' (
52
52
node : TSESTree . UnaryExpression ,
53
53
) : void {
54
- if ( node . argument . type !== AST_NODE_TYPES . MemberExpression ) {
54
+ const { argument } = node ;
55
+
56
+ if ( argument . type !== AST_NODE_TYPES . MemberExpression ) {
55
57
return ;
56
58
}
57
59
58
- const type = getConstrainedTypeAtLocation (
59
- services ,
60
- node . argument . object ,
61
- ) ;
60
+ const type = getConstrainedTypeAtLocation ( services , argument . object ) ;
62
61
63
62
if ( ! isUnderlyingTypeArray ( type ) ) {
64
63
return ;
@@ -71,11 +70,7 @@ export default createRule<[], MessageId>({
71
70
{
72
71
messageId : 'useSplice' ,
73
72
fix ( fixer ) : TSESLint . RuleFix | null {
74
- if ( node . argument . type !== AST_NODE_TYPES . MemberExpression ) {
75
- return null ;
76
- }
77
-
78
- const { object, property } = node . argument ;
73
+ const { object, property } = argument ;
79
74
80
75
const shouldHaveParentheses =
81
76
property . type === AST_NODE_TYPES . SequenceExpression ;
You can’t perform that action at this time.
0 commit comments