小编mrt*_*mrt的帖子

tslint:不允许使用命名空间和模块

我最近得到了一个旧的 .ts 文件并想更新它。

两个警告说:

'namespace' and 'module' are disallowed

The internal 'module' syntax is deprecated, use the 'namespace' keyword instead.

我阅读了有关使用标准化 ES6 样式外部模块的信息,但我不知道如何执行此操作。

我的代码如下所示:

export namespace MySpace
{
  export module MyModule
  {
    export interface MyInterface
    {
    }

    export class MyClass
    {
    }
    ...
  }
}
Run Code Online (Sandbox Code Playgroud)

谁能给我一个提示,如何将此结构更新为实际的样式规则?

非常感谢大家!

此致

地铁

namespaces module typescript tslint

12
推荐指数
1
解决办法
9994
查看次数

标签 统计

module ×1

namespaces ×1

tslint ×1

typescript ×1