A namespace is declared with the old keyword module
What it finds
module Shapes { ... }: before ES modules, TypeScript called namespaces modules. The keyword now reads as if it declared an ES module, which it does not, and newer TypeScript versions report it as deprecated. namespace Shapes means the same.
Declarations of external modules, as declare module "lib" { ... }, are left alone. The fix replaces the keyword with namespace and is safe.
From the rule's source, legacy_module_keyword.rs.
module Shapes {tx0 reports: module here declares a namespace export const sides = 4;}namespace Colors { export const red = "red";}declare module "lib" { export const x: number;} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:legacy-module-keyword" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:legacy-module-keyword] reason="..."tx0 explain tx0/ts:legacy-module-keyword shows the same in the terminal. Found a false positive? Report it.