Skip to content

Commit e133db3

Browse files
committed
check for indexes length
1 parent 9c26b38 commit e133db3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/sort-comp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ module.exports = {
172172
}
173173
}
174174

175-
if (method.static && method.name !== 'getDerivedStateFromProps') {
175+
if (indexes.length === 0 && method.static) {
176176
const staticIndex = methodsOrder.indexOf('static-methods');
177177
if (staticIndex >= 0) {
178178
indexes.push(staticIndex);

0 commit comments

Comments
 (0)