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

Commit

Permalink
fix(no-single-declare-module): allow single wildcard module declarati…
Browse files Browse the repository at this point in the history
…on (#339)
  • Loading branch information
GauBen authored Aug 11, 2021
1 parent b0ddfa0 commit fc56160
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rules/noSingleDeclareModuleRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function walk(ctx: Lint.WalkContext<void>): void {
let moduleDecl: ts.ModuleDeclaration | undefined;
for (const statement of sourceFile.statements) {
if (ts.isModuleDeclaration(statement) && ts.isStringLiteral(statement.name)) {
if (statement.name.text.indexOf('*') !== -1) {
// Ignore wildcard module declarations
return;
}

if (moduleDecl === undefined) {
moduleDecl = statement;
} else {
Expand Down
1 change: 1 addition & 0 deletions test/no-single-declare-module/wildcard.d.ts.lint
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "*.svg" {}

0 comments on commit fc56160

Please sign in to comment.