目录

@typescript-eslint/no-namespace

Disallow TypeScript namespaces.

Namespace is an outdated syntax. You are advised to use import/export.

This rule applies only to .js and .ts files.

Rule Configuration

// code-linter.json5
{
  "rules": {
    "@typescript-eslint/no-namespace": "error"
  }
}

Options

For details, see @typescript-eslint/no-namespace.

Example of Correct Code

// foo is a module name.
declare module 'foo' {}
// anything inside a d.ts file

Example of Incorrect Code

module foo {}
namespace foo {}

declare module foo {}
declare namespace foo {}

Rule Set

plugin:@typescript-eslint/all

For details about how to configure Code Linter check rules, see Code Linter.