Urara-Blog/node_modules/.pnpm-store/v3/files/0b/c92da4918ac042155ac95435269b76e5f045d4e3cdd6bb70cb54e4539129a6e9750e4b8ce789175a84b1a2e203a5b5b048f841d45f089588ceab214eeed379
2022-08-14 01:14:53 +08:00

37 lines
1.1 KiB
Text

---
description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules.'
---
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/prefer-namespace-keyword** for documentation.
In an effort to prevent further confusion between custom TypeScript modules and the new ES2015 modules, starting
with TypeScript `v1.5` the keyword `namespace` is now the preferred way to declare custom TypeScript modules.
## Rule Details
This rule aims to standardize the way modules are declared.
## When Not To Use It
If you are using the ES2015 module syntax, then you will not need this rule.
## Options
```jsonc
// .eslintrc.json
{
"rules": {
"@typescript-eslint/prefer-namespace-keyword": "error"
}
}
```
This rule is not configurable.
## Further Reading
- [Modules](https://www.typescriptlang.org/docs/handbook/modules.html)
- [Namespaces](https://www.typescriptlang.org/docs/handbook/namespaces.html)
- [Namespaces and Modules](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html)