Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit fc56160

Browse files
authored
fix(no-single-declare-module): allow single wildcard module declaration (#339)
1 parent b0ddfa0 commit fc56160

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/rules/noSingleDeclareModuleRule.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ function walk(ctx: Lint.WalkContext<void>): void {
3434
let moduleDecl: ts.ModuleDeclaration | undefined;
3535
for (const statement of sourceFile.statements) {
3636
if (ts.isModuleDeclaration(statement) && ts.isStringLiteral(statement.name)) {
37+
if (statement.name.text.indexOf('*') !== -1) {
38+
// Ignore wildcard module declarations
39+
return;
40+
}
41+
3742
if (moduleDecl === undefined) {
3843
moduleDecl = statement;
3944
} else {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module "*.svg" {}

0 commit comments

Comments
 (0)