Open amannn opened 4 years ago
I recently came across this: https://github.com/azat-io/eslint-plugin-perfectionist. Could be helpful in this regard.
There's been an update: https://github.com/jsx-eslint/eslint-plugin-react/issues/2702#issuecomment-2097676139
The background is that
react/sort-prop-types
currently doesn't work for TypeScript prop types.If
.tsx
files are exclusively used for React components, a workaround could be to be more strict in those files and applytypescript/member-ordering
there.Note that this will have some false positives, but it might be a pragmatic solution.
I'm not sure if this is a good idea though. A lot of codebases use
.tsx
for all TypeScript files, regardless if they contain JSX or not. When in doubt, we should maybe leave this turned off.