Skip to content

Commit

Permalink
chore: move type node visition inside checks and change tc feature
Browse files Browse the repository at this point in the history
  • Loading branch information
akulsr0 committed Aug 16, 2023
1 parent 70c21f1 commit 329c495
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/rules/sort-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ module.exports = {
}
});
},

}, checkTypes ? {
TSTypeLiteral(node) {
if (node && node.parent.id) {
const currentNode = [].concat(
Expand Down Expand Up @@ -325,7 +325,6 @@ module.exports = {
typeAnnotations.set(node.id.name, currentNode);
}
},
}, checkTypes ? {
FunctionDeclaration: handleFunctionComponent,
ArrowFunctionExpression: handleFunctionComponent,
} : null);
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/sort-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ ruleTester.run('sort-prop-types', rule, {
return null;
}
`,
features: ['ts', 'no-babel'],
features: ['types'],
options: [{ checkTypes: false }],
}
)),
Expand Down

0 comments on commit 329c495

Please sign in to comment.