-
Notifications
You must be signed in to change notification settings - Fork 19
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
Mixing arrow function properties with methods #49
Comments
I think you're right. There isn't currently a way to define a group whose matches are unordered. I imagine this could be useful for React components, where methods are often converted to arrow function properties to avoid binding issues. This is almost it, except it requires methods to come before properties groups: {
methodOrFuncProperty: [
{ type: 'method' },
{ type: 'property', propertyType: 'ArrowFunctionExpression' },
],
}, There is a groups: {
methodOrFuncProperty: {
rules: [
{ type: 'method' },
{ type: 'property', propertyType: 'ArrowFunctionExpression' },
],
sort: 'none',
},
}, |
Yes, this will solve the problem! I can try to implement this feature and send a PR. |
Thanks |
@bryanrsmith - I am confused, above config will work or proposed? |
No, it's is not currently supported. I was proposing that the |
@bryanrsmith - may you guide me, I can try for a PR. |
You can already wrap the arrow functions with
|
Any update on this? I'm also interested. Maybe instead of |
No updates. I haven't personally used this plugin in a long time, as classes are not a language feature I use much any more. I'm happy to review PRs, but I'm not very motivated to put any effort into new features myself. Sounds like a plan has been proposed earlier in the thread, so feel free to take a stab at it. |
Just curious, what pattern are you using now? Functional programming? Split of data and procedures? |
Yep. I do a lot of React work, and my class use dropped off pretty hard when React introduced hooks in 2019. |
Ok, make sense. Personally I think hooks were an error, I still prefer classes, but if they are useful to you, that's fine :-) |
I haven't found a way to treat methods and arrow function properties as a single group. Is this currently possible? I'd like to treat arrow function properties as methods and sort them alphabetically together, like this:
The text was updated successfully, but these errors were encountered: