regexFind: /(public|private|protected|static|async|readonly)\s+(const|let|var|function|class|interface|type)/
regexReplace: $2Remove accessibility modifier from module or namespace element. Modules and namespaces cannot have accessibility modifiers like public, private, or protected.
module TestModule {
- public const value = 42
+ const value = 42
}Explanation: Remove public modifier from module element
namespace MyNamespace {
- private function helper() {}
+ function helper() {}
}Explanation: Remove private modifier from namespace element
npx tsc ./docs/1044/index.ts --noEmit --prettydocs/1044/index.ts:2:3 - error TS1044: 'public' modifier cannot appear on a module or namespace element.
2 public const value = 42
~~~~~OR (without --pretty flag):
docs/1044/index.ts(2,3): error TS1044: 'public' modifier cannot appear on a module or namespace element.