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

Commit 61d8998

Browse files
committed
typesVersions parent isn't external dependency
1 parent a6b1ca9 commit 61d8998

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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)