molindo / eslint-config-molindo

ESLint config that implements the Molindo styleguide and helps to catch errors
MIT License
1 stars 2 forks source link

Consider `member-ordering` in `.tsx` files. #51

Open amannn opened 4 years ago

amannn commented 4 years ago

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 commented 7 months ago

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

amannn commented 4 months ago

There's been an update: https://github.com/jsx-eslint/eslint-plugin-react/issues/2702#issuecomment-2097676139