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

Commit

Permalink
typesVersions parent isn't external
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko authored Nov 5, 2020
1 parent a6b1ca9 commit ed4d766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TypeScriptVersion } from "@definitelytyped/typescript-versions";
import { typeScriptPath } from "@definitelytyped/utils";
import assert = require("assert");
import { pathExists } from "fs-extra";
import { join as joinPaths, normalize } from "path";
import { basename, dirname, join as joinPaths, normalize } from "path";
import { Configuration, ILinterOptions, Linter } from "tslint";
import * as TsType from "typescript";
type Configuration = typeof Configuration;
Expand Down Expand Up @@ -80,7 +80,7 @@ function testDependencies(
}

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

function normalizePath(file: string) {
Expand Down

0 comments on commit ed4d766

Please sign in to comment.