Comparing version 0.5.6 to 0.5.7
@@ -29,3 +29,3 @@ "use strict"; | ||
}; | ||
if (!util_1.isMainFile(sourceFile.fileName)) { | ||
if (!util_1.isMainFile(sourceFile.fileName, /*allowNested*/ true)) { | ||
lookFor("// Type definitions for", "Header should only be in `index.d.ts` of the root."); | ||
@@ -32,0 +32,0 @@ lookFor("// TypeScript Version", "TypeScript version should be specified under header in `index.d.ts`."); |
@@ -29,3 +29,3 @@ "use strict"; | ||
}; | ||
if (util_1.isMainFile(sourceFile.fileName)) { | ||
if (util_1.isMainFile(sourceFile.fileName, /*allowNested*/ false)) { | ||
try { | ||
@@ -32,0 +32,0 @@ critic(sourceFile.fileName); |
@@ -106,3 +106,3 @@ "use strict"; | ||
exports.mapDefinedAsync = mapDefinedAsync; | ||
function isMainFile(fileName) { | ||
function isMainFile(fileName, allowNested) { | ||
// Linter may be run with cwd of the package. We want `index.d.ts` but not `submodule/index.d.ts` to match. | ||
@@ -118,3 +118,3 @@ if (fileName === "index.d.ts") { | ||
// Note a types redirect `foo/ts3.1` should not have its own header. | ||
if (/^v\d+$/.test(path_1.basename(parent))) { | ||
if (allowNested && /^v\d+$/.test(path_1.basename(parent))) { | ||
parent = path_1.dirname(parent); | ||
@@ -121,0 +121,0 @@ } |
{ | ||
"name": "dtslint", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "Runs tests on TypeScript definition files", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
181197