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

react/sort-comp static-variables #2405

Closed
rhalaly opened this issue Sep 9, 2019 · 2 comments · Fixed by #2408
Closed

react/sort-comp static-variables #2405

rhalaly opened this issue Sep 9, 2019 · 2 comments · Fixed by #2408

Comments

@rhalaly
Copy link

rhalaly commented Sep 9, 2019

The order:

"instance-variables",
"constructor",
"static-methods",
"lifecycle",
"everything-else"
"render",                   

Is mistaking with static members.

For example:

private static const wrong_var = 1;
private b;

constructor(props: any) {
        super(props);

        this.state = {
            ....
        };
}

Throws:

error wrong_var should be placed after constructor react/sort-comp

Which is wrong....

Can you please add "static-variables" as option in the rule?
Expect to be something like:

"static-variables",
"instance-variables",
"constructor",
"static-methods",
"lifecycle",
"everything-else"
"render",                   
@ljharb
Copy link
Member

ljharb commented Sep 10, 2019

That seems reasonable.

@rhalaly
Copy link
Author

rhalaly commented Sep 12, 2019

Thanks for the rapid response.
When this feature will be released?

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

Successfully merging a pull request may close this issue.

2 participants