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

Commit 31ee969

Browse files
committed
typesVersions parent isn't external dependency
1 parent a6b1ca9 commit 31ee969

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.travis.yml

+15
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ branches:
1111

1212
install:
1313
- npm install
14+
- patch --directory node_modules/dts-critic --strip 1 <<'patchfile
15+
--- a/dist/index.js
16+
+++ b/dist/index.js
17+
@@ -307,9 +307,7 @@ function downloadNpmPackage(name, version, outDir) {
18+
const npmName = dtToNpmName(name);
19+
const fullName = `${npmName}@${version}`;
20+
const cpOpts = { encoding: "utf8", maxBuffer: 100 * 1024 * 1024 };
21+
- const npmPack = cp.execFileSync("npm", ["pack", fullName, "--json", "--silent"], cpOpts);
22+
- const npmPackOut = JSON.parse(npmPack)[0];
23+
- const tarballName = npmPackOut.filename;
24+
+ const tarballName = cp.execFileSync("npm", ["pack", fullName, "--silent"], cpOpts).slice(0, -1);
25+
const outPath = path.join(outDir, name);
26+
initDir(outPath);
27+
const args = os.platform() === "darwin"
28+
patchfile
1429

1530
git:
1631
depth: 1

src/lint.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TypeScriptVersion } from "@definitelytyped/typescript-versions";
22
import { typeScriptPath } from "@definitelytyped/utils";
33
import assert = require("assert");
44
import { pathExists } from "fs-extra";
5-
import { join as joinPaths, normalize } from "path";
5+
import { basename, dirname, join as joinPaths, normalize } from "path";
66
import { Configuration, ILinterOptions, Linter } from "tslint";
77
import * as TsType from "typescript";
88
type Configuration = typeof Configuration;
@@ -80,7 +80,8 @@ function testDependencies(
8080
}
8181

8282
export function isExternalDependency(file: TsType.SourceFile, dirPath: string, program: TsType.Program): boolean {
83-
return !startsWithDirectory(file.fileName, dirPath) || program.isSourceFileFromExternalLibrary(file);
83+
return !startsWithDirectory(file.fileName, /^ts\d+\.\d$/.test(basename(dirPath)) ? dirname(dirPath) : dirPath) ||
84+
program.isSourceFileFromExternalLibrary(file);
8485
}
8586

8687
function normalizePath(file: string) {

0 commit comments

Comments
 (0)