@@ -76,9 +76,10 @@ export default util.createRule<Options, MessageIds>({
76
76
| TSESTree . ArrowFunctionExpression
77
77
| TSESTree . FunctionDeclaration
78
78
| TSESTree . FunctionExpression
79
- | TSESTree . TSAbstractMethodDefinition ,
79
+ | TSESTree . TSEmptyBodyFunctionExpression
80
+ | TSESTree . TSDeclareFunction ,
80
81
) : boolean {
81
- if ( 'id' in node && node . id != null ) {
82
+ if ( node . id != null ) {
82
83
return true ;
83
84
}
84
85
@@ -102,7 +103,8 @@ export default util.createRule<Options, MessageIds>({
102
103
| TSESTree . ArrowFunctionExpression
103
104
| TSESTree . FunctionDeclaration
104
105
| TSESTree . FunctionExpression
105
- | TSESTree . TSAbstractMethodDefinition ,
106
+ | TSESTree . TSEmptyBodyFunctionExpression
107
+ | TSESTree . TSDeclareFunction ,
106
108
) : FuncOption {
107
109
if ( node . type === AST_NODE_TYPES . ArrowFunctionExpression ) {
108
110
// Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar
@@ -116,7 +118,7 @@ export default util.createRule<Options, MessageIds>({
116
118
return overrideConfig . named ?? baseConfig ;
117
119
118
120
// `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}`
119
- } else if ( ! ( 'generator' in node ) || node . generator === false ) {
121
+ } else if ( ! node . generator ) {
120
122
return overrideConfig . anonymous ?? baseConfig ;
121
123
}
122
124
@@ -133,7 +135,8 @@ export default util.createRule<Options, MessageIds>({
133
135
| TSESTree . ArrowFunctionExpression
134
136
| TSESTree . FunctionDeclaration
135
137
| TSESTree . FunctionExpression
136
- | TSESTree . TSAbstractMethodDefinition ,
138
+ | TSESTree . TSEmptyBodyFunctionExpression
139
+ | TSESTree . TSDeclareFunction ,
137
140
) : void {
138
141
const functionConfig = getConfigForFunction ( node ) ;
139
142
@@ -165,7 +168,7 @@ export default util.createRule<Options, MessageIds>({
165
168
} else if (
166
169
! hasSpacing &&
167
170
functionConfig === 'always' &&
168
- ( ! node . typeParameters || ( 'id' in node && node != null ) )
171
+ ( ! node . typeParameters || node . id )
169
172
) {
170
173
context . report ( {
171
174
node,
@@ -180,7 +183,8 @@ export default util.createRule<Options, MessageIds>({
180
183
ArrowFunctionExpression : checkFunction ,
181
184
FunctionDeclaration : checkFunction ,
182
185
FunctionExpression : checkFunction ,
183
- TSAbstractMethodDefinition : checkFunction ,
186
+ TSEmptyBodyFunctionExpression : checkFunction ,
187
+ TSDeclareFunction : checkFunction ,
184
188
} ;
185
189
} ,
186
190
} ) ;
0 commit comments