Skip to content

Commit 329c495

Browse files
committed
chore: move type node visition inside checks and change tc feature
1 parent 70c21f1 commit 329c495

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/rules/sort-prop-types.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ module.exports = {
295295
}
296296
});
297297
},
298-
298+
}, checkTypes ? {
299299
TSTypeLiteral(node) {
300300
if (node && node.parent.id) {
301301
const currentNode = [].concat(
@@ -325,7 +325,6 @@ module.exports = {
325325
typeAnnotations.set(node.id.name, currentNode);
326326
}
327327
},
328-
}, checkTypes ? {
329328
FunctionDeclaration: handleFunctionComponent,
330329
ArrowFunctionExpression: handleFunctionComponent,
331330
} : null);

tests/lib/rules/sort-prop-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ ruleTester.run('sort-prop-types', rule, {
491491
return null;
492492
}
493493
`,
494-
features: ['ts', 'no-babel'],
494+
features: ['types'],
495495
options: [{ checkTypes: false }],
496496
}
497497
)),

0 commit comments

Comments
 (0)