regexFind: /(static)\s+(public|private|protected)\s+/
regexReplace: $2 $1 Reorder modifiers correctly. Accessibility modifiers (public, private, protected) must come before static modifier.
class MyClass {
- static public method() {
+ public static method() {
return 'test'
}
}Explanation: Move public modifier before static modifier
class DataClass {
- static private property = 'data'
+ private static property = 'data'
}Explanation: Move private modifier before static modifier
npx tsc ./docs/1029/index.ts --noEmit --prettydocs/1029/index.ts:2:10 - error TS1029: 'public' modifier must precede 'static' modifier.
2 static public method() {
~~~~~~OR (without --pretty flag):
docs/1029/index.ts(2,10): error TS1029: 'public' modifier must precede 'static' modifier.