regexFind: /(readonly|static|async)\s+(readonly|static|async)\s+/
regexReplace: $1 Remove duplicate modifier. Each class member can only have one instance of the same modifier (readonly, static, async).
class MyClass {
- readonly readonly property = 'test'
+ readonly property = 'test'
}Explanation: Remove duplicate readonly modifier from property declaration
class DataClass {
- static static method() {
+ static method() {
return 'data'
}
}Explanation: Remove duplicate static modifier from method declaration
npx tsc ./docs/1030/index.ts --noEmit --prettydocs/1030/index.ts:2:12 - error TS1030: 'readonly' modifier already seen.
2 readonly readonly property = 'test'
~~~~~~~~OR (without --pretty flag):
docs/1030/index.ts(2,12): error TS1030: 'readonly' modifier already seen.