src/content/docs/linter/rules/no-namespace.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="TypeScript and TSX" icon="seti:typescript"> ## Summary - Rule available since: `v1.0.0` - Diagnostic Category: [`lint/style/noNamespace`](/reference/diagnostics#diagnostic-category) - This rule isn't recommended, so you need to enable it. - This rule doesn't have a fix. - The default severity of this rule is [**warning**](/reference/diagnostics#warning). - Sources: - Same as [`@typescript-eslint/no-namespace`](https://typescript-eslint.io/rules/no-namespace){
"linter": {
"rules": {
"style": {
"noNamespace": "error"
}
}
}
}
Disallow the use of TypeScript's namespaces.
Namespaces are an old way to organize your code in TypeScript.
They are not recommended anymore and should be replaced by ES6 modules
(the import/export syntax).
module foo {}
declare module foo {}
namespace foo {}
declare namespace foo {}
import foo from 'foo';
export { bar };
declare global {}
declare module 'foo' {}