Currently, our eslint config requires instance variables to be defined after the constructor and lifecycle handlers like below.
constructor() {
this.myProp = doSomething();
}
onComponentDidMount() {
doSomethingElse();
}
myProp;
If we add instance-variables to the order before lifecycle, then this should require instance variables be defined before the constructor and after static members like below. This only applies to jsx/tsx files.
myProp;
constructor() {
this.myProp = doSomething();
}
onComponentDidMount() {
doSomethingElse();
}
It will require some manual fixing as the rule doesn't have auto-fix.