Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider member-ordering in .tsx files. #51

Open
amannn opened this issue Jul 31, 2020 · 2 comments
Open

Consider member-ordering in .tsx files. #51

amannn opened this issue Jul 31, 2020 · 2 comments

Comments

@amannn
Copy link
Member

amannn commented Jul 31, 2020

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 apply typescript/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.

@amannn
Copy link
Member Author

amannn commented Feb 14, 2024

I recently came across this: https://github.com/azat-io/eslint-plugin-perfectionist. Could be helpful in this regard.

@amannn
Copy link
Member Author

amannn commented May 7, 2024

There's been an update: jsx-eslint/eslint-plugin-react#2702 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant