@@ -19,6 +19,7 @@ import { isNodeEslintDisabled } from '../utils/is-node-eslint-disabled'
19
19
import { hasPartitionComment } from '../utils/is-partition-comment'
20
20
import { sortNodesByGroups } from '../utils/sort-nodes-by-groups'
21
21
import { getCommentsBefore } from '../utils/get-comments-before'
22
+ import { getNodeDecorators } from '../utils/get-node-decorators'
22
23
import { createEslintRule } from '../utils/create-eslint-rule'
23
24
import { getDecoratorName } from '../utils/get-decorator-name'
24
25
import { getGroupNumber } from '../utils/get-group-number'
@@ -163,19 +164,31 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
163
164
} ,
164
165
PropertyDefinition : propertyDefinition =>
165
166
options . sortOnProperties
166
- ? sortDecorators ( context , options , propertyDefinition . decorators )
167
+ ? sortDecorators (
168
+ context ,
169
+ options ,
170
+ getNodeDecorators ( propertyDefinition ) ,
171
+ )
167
172
: null ,
168
173
AccessorProperty : accessorDefinition =>
169
174
options . sortOnAccessors
170
- ? sortDecorators ( context , options , accessorDefinition . decorators )
175
+ ? sortDecorators (
176
+ context ,
177
+ options ,
178
+ getNodeDecorators ( accessorDefinition ) ,
179
+ )
171
180
: null ,
172
181
MethodDefinition : methodDefinition =>
173
182
options . sortOnMethods
174
- ? sortDecorators ( context , options , methodDefinition . decorators )
183
+ ? sortDecorators (
184
+ context ,
185
+ options ,
186
+ getNodeDecorators ( methodDefinition ) ,
187
+ )
175
188
: null ,
176
- ClassDeclaration : Declaration =>
189
+ ClassDeclaration : declaration =>
177
190
options . sortOnClasses
178
- ? sortDecorators ( context , options , Declaration . decorators )
191
+ ? sortDecorators ( context , options , getNodeDecorators ( declaration ) )
179
192
: null ,
180
193
}
181
194
} ,
0 commit comments