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

Commit

Permalink
Loosen DefinitelyTyped naming requirement
Browse files Browse the repository at this point in the history
Azure Pipelines doesn't fulfill it right now. I'll re-enable it later if
it makes sense.

Also make the detail-free error message more detailed.
  • Loading branch information
sandersn committed Mar 26, 2019
1 parent 94454d0 commit e24e57b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,15 @@ async function testTypesVersion(
function assertPathIsInDefinitelyTyped(dirPath: string): void {
const parent = dirname(dirPath);
const types = /^v\d+$/.test(basename(dirPath)) ? dirname(parent) : parent;
const dt = dirname(types);
if (basename(dt) !== "DefinitelyTyped" || basename(types) !== "types") {
// TODO: It's not clear whether this assertion makes sense, and it's broken on Azure Pipelines
// Re-enable it later if it makes sense.
// const dt = dirname(types);
// if (basename(dt) !== "DefinitelyTyped" || basename(types) !== "types") {
if (basename(types) !== "types") {
throw new Error("Since this type definition includes a header (a comment starting with `// Type definitions for`), "
+ "assumed this was a DefinitelyTyped package.\n"
+ "But it is not in a `DefinitelyTyped/types/xxx` directory.");
+ "But it is not in a `DefinitelyTyped/types/xxx` directory: "
+ dirPath);
}
}

Expand Down

0 comments on commit e24e57b

Please sign in to comment.