Skip to content

Commit ea801a6

Browse files
armano2JamesHenry
authored andcommitted
[FIX] [no-namespace] allow global augmentation (typescript-eslint#208)
1 parent ae9ae58 commit ea801a6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/eslint-plugin-typescript/lib/rules/no-namespace.js

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ module.exports = {
8686
return {
8787
TSModuleDeclaration(node) {
8888
if (
89+
node.global ||
8990
isTypeScriptModuleDeclaration(node) ||
9091
(allowDefinitionFiles && isDefinitionFile()) ||
9192
(allowDeclarations && isDeclaration(node))

packages/eslint-plugin-typescript/tests/lib/rules/no-namespace.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const ruleTester = new RuleTester({
2121

2222
ruleTester.run("no-namespace", rule, {
2323
valid: [
24+
"declare global { }",
2425
"declare module 'foo' { }",
2526
{
2627
code: "declare module foo { }",

0 commit comments

Comments
 (0)