⬅️ Back to Table of Contents
📄 no-namespace.ts
📊 Analysis Summary
Metric |
Count |
🔧 Functions |
1 |
📦 Imports |
4 |
📑 Type Aliases |
2 |
📚 Table of Contents
🛠️ File Location:
📂 packages/eslint-plugin/src/rules/no-namespace.ts
📦 Imports
Name |
Source |
TSESTree |
@typescript-eslint/utils |
AST_NODE_TYPES |
@typescript-eslint/utils |
createRule |
../util |
isDefinitionFile |
../util |
Functions
isDeclaration(node: TSESTree.Node): boolean
Code
function isDeclaration(node: TSESTree.Node): boolean {
if (node.type === AST_NODE_TYPES.TSModuleDeclaration && node.declare) {
return true;
}
return node.parent != null && isDeclaration(node.parent);
}
- Parameters:
node: TSESTree.Node
- Return Type:
boolean
- Calls:
isDeclaration
Type Aliases
Options
type Options = [
{
allowDeclarations?: boolean;
allowDefinitionFiles?: boolean;
},
];
MessageIds
type MessageIds = 'moduleSyntaxIsPreferred';