I have the following rules in my tslint.json :
"member-ordering": [
true,
{
"order": [
"public-before-private",
"static-before-instance",
"variables-before-functions"
]
}
],
However I still get this warning :
Warning: member-ordering - Bad member kind: public-before-private
Typescrypt version is 3.1.1
Node version is 10.10.0
As the error message says, the values you put in the order array are not recognized by tslint. Read about member-ordering in the documentation of the member-ordering rule.
You can specify in tslint.json the exact order you want or you can specify only some components (f.e. let the static methods out) and the missing components can stay anywhere in the class.
The following configuration matches the rules you expressed:
"member-ordering": [
true,
{
"order": [
"public-static-field",
"public-static-method",
"public-instance-field",
"public-constructor",
"public-instance-method",
"protected-static-field",
"protected-static-method",
"protected-instance-field",
"protected-constructor",
"protected-instance-method",
"private-static-field",
"private-static-method",
"private-instance-field",
"private-constructor",
"private-instance-method"
]
}
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With