-
Notifications
You must be signed in to change notification settings - Fork 45
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
Feature: trying to enforce a specific order within custom groups leads to complicated config #419
Comments
Could you please give a code example including:
This will help us better understand what feature you are looking for. |
Oh, the config I'm using works, it's just not ideal for this case. Ideally, I could define a single {
groupName: 'react-lifecycle',
elements: [
'componentWillMount',
'componentDidMount',
// etc...
],
} Where |
Class components aren't used as much in React these days, so I understand if this isn't something to work on right away, I just wanted to point it out and see if there was a better way to configure this that I've missed |
@hugop95, I think #408 (comment) would address the need |
I'm actually not sure if this falls under the same need as what we discussed in #408: if I understand correctly:
What is the objective behind this? Let's consider that you have {
groupName: 'react-lifecycle',
elements: [
"componentWillMount",
"componentDidMount",
// etc...
],
} and {
groupName: 'other-stuff',
elements: [
"otherStuff1",
"otherStuff2",
// etc...
],
} I assume you would want your groups to look like groups: [
"react-lifecycle",
"other-stuff"
] Is this better than doing groups: [
"componentWillMount",
"componentDidMount",
"otherStuff1",
"otherStuff2",
] ? Can you confirm that this is solely for convenience (and not a missing feature) purpose?
This is regrouping two things in one:
I see two potential issues:
[
"component",
"comp.*",
"com.*",
] Where should |
What rule do you want to change?
sort-classes
Describe the problem
I'm using
perfectionist/sort-classes
as a replacement forreact/sort-comp
which is autofixable, but I'm also trying to follow Airbnb's class order, which leads to a very verbose config for the rule...Code example
Additional comments
Is there any way to configure a specific order within custom groups that I'm missing?
Validations
The text was updated successfully, but these errors were encountered: