@@ -21,8 +21,8 @@ const messages = {
21
21
} as const ;
22
22
type MessageIds = keyof typeof messages ;
23
23
24
- const ngOnDestroyMethodSelector =
25
- " MethodDefinition[key.name='ngOnDestroy'][kind='method']" ;
24
+ const ngOnDestroyMethodSelector
25
+ = ' MethodDefinition[key.name=\ 'ngOnDestroy\ '][kind=\ 'method\']' ;
26
26
27
27
const defaultOptions : readonly {
28
28
alias ?: string [ ] ;
@@ -50,7 +50,7 @@ export const preferTakeuntilRule = ruleCreator({
50
50
checkComplete : { type : 'boolean' , description : 'Check for `complete` calls.' } ,
51
51
checkDecorators : { type : 'array' , items : { type : 'string' } , description : 'An optional array of decorator names to check.' } ,
52
52
checkDestroy : { type : 'boolean' , description : 'Check for `Subject`-based `ngOnDestroy`.' } ,
53
- superClass : { type : " array" , items : { type : " string" } } ,
53
+ superClass : { type : ' array' , items : { type : ' string' } } ,
54
54
} ,
55
55
type : 'object' ,
56
56
description : stripIndent `
@@ -166,33 +166,33 @@ export const preferTakeuntilRule = ruleCreator({
166
166
if ( extendsSuperClassDeclaration ) {
167
167
if ( ! superNgOnDestroyCallExpression ) {
168
168
check . descriptors . push ( {
169
- data : { method : " ngOnDestroy" , name : " super" } ,
170
- messageId : " notCalled" ,
169
+ data : { method : ' ngOnDestroy' , name : ' super' } ,
170
+ messageId : ' notCalled' ,
171
171
node : ngOnDestroyDefinition . key ,
172
172
} ) ;
173
173
}
174
174
} else {
175
175
if ( ! checkSubjectProperty ( name , entry ) ) {
176
176
check . descriptors . push ( {
177
177
data : { name } ,
178
- messageId : " notDeclared" ,
178
+ messageId : ' notDeclared' ,
179
179
node : classDeclaration . id ?? classDeclaration ,
180
180
} ) ;
181
181
}
182
182
if ( ! checkSubjectCall ( name , nextCallExpressions ) ) {
183
183
check . descriptors . push ( {
184
- data : { method : " next" , name } ,
185
- messageId : " notCalled" ,
184
+ data : { method : ' next' , name } ,
185
+ messageId : ' notCalled' ,
186
186
node : ngOnDestroyDefinition . key ,
187
187
} ) ;
188
188
}
189
189
if (
190
- checkComplete &&
191
- ! checkSubjectCall ( name , completeCallExpressions )
190
+ checkComplete
191
+ && ! checkSubjectCall ( name , completeCallExpressions )
192
192
) {
193
193
check . descriptors . push ( {
194
- data : { method : " complete" , name } ,
195
- messageId : " notCalled" ,
194
+ data : { method : ' complete' , name } ,
195
+ messageId : ' notCalled' ,
196
196
node : ngOnDestroyDefinition . key ,
197
197
} ) ;
198
198
}
@@ -331,8 +331,8 @@ export const preferTakeuntilRule = ruleCreator({
331
331
) ;
332
332
}
333
333
334
- const extendsSuperClassDeclaration =
335
- superClass . length === 0
334
+ const extendsSuperClassDeclaration
335
+ = superClass . length === 0
336
336
? { }
337
337
: {
338
338
[ `ClassDeclaration:matches(${ superClass
0 commit comments