diff --git a/src/lib/application.ts b/src/lib/application.ts index f069f22d4..d3d6e1a04 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -5,7 +5,13 @@ import { Converter } from "./converter/index"; import { Renderer } from "./output/renderer"; import { Deserializer, JSONOutput, Serializer } from "./serialization"; import type { ProjectReflection } from "./models/index"; -import { Logger, ConsoleLogger, loadPlugins, writeFile, normalizePath } from "./utils/index"; +import { + Logger, + ConsoleLogger, + loadPlugins, + writeFile, + normalizePath, +} from "./utils/index"; import { AbstractComponent, @@ -585,7 +591,11 @@ export class Application extends ChildableComponent< const start = Date.now(); const rootDir = deriveRootDir(this.entryPoints); - this.logger.verbose(`Derived root dir is ${rootDir}, will expand ${this.entryPoints.map(normalizePath).join(", ")}`) + this.logger.verbose( + `Derived root dir is ${rootDir}, will expand ${this.entryPoints + .map(normalizePath) + .join(", ")}` + ); const entryPoints = this.entryPoints.flatMap((entry) => glob(entry, rootDir) ); diff --git a/src/lib/models/reflections/ReflectionSymbolId.ts b/src/lib/models/reflections/ReflectionSymbolId.ts index 5026d466b..21089ad05 100644 --- a/src/lib/models/reflections/ReflectionSymbolId.ts +++ b/src/lib/models/reflections/ReflectionSymbolId.ts @@ -36,7 +36,9 @@ export class ReflectionSymbolId { ) { if ("name" in symbol) { declaration ??= symbol?.declarations?.[0]; - this.fileName = normalizePath(declaration?.getSourceFile().fileName ?? "\0"); + this.fileName = normalizePath( + declaration?.getSourceFile().fileName ?? "\0" + ); if (symbol.declarations?.some(ts.isSourceFile)) { this.qualifiedName = ""; } else { @@ -61,10 +63,12 @@ export class ReflectionSymbolId { toObject(serializer: Serializer) { return { sourceFileName: isAbsolute(this.fileName) - ? normalizePath(relative( - serializer.projectRoot, - resolveDeclarationMaps(this.fileName) - )) + ? normalizePath( + relative( + serializer.projectRoot, + resolveDeclarationMaps(this.fileName) + ) + ) : this.fileName, qualifiedName: this.qualifiedName, }; diff --git a/src/lib/utils/fs.ts b/src/lib/utils/fs.ts index 40f755657..7508e204f 100644 --- a/src/lib/utils/fs.ts +++ b/src/lib/utils/fs.ts @@ -23,7 +23,7 @@ export function isDir(path: string) { } export function deriveRootDir(globPaths: string[]): string { - const normalized = globPaths.map(normalizePath) + const normalized = globPaths.map(normalizePath); const globs = createMinimatch(normalized); const rootPaths = globs.flatMap((glob, i) => filterMap(glob.set, (set) => { @@ -31,8 +31,11 @@ export function deriveRootDir(globPaths: string[]): string { if (stop === -1) { return normalized[i]; } else { - const kept = set.slice(0, stop).join('/') - return normalized[i].substring(0, normalized[i].indexOf(kept) + kept.length); + const kept = set.slice(0, stop).join("/"); + return normalized[i].substring( + 0, + normalized[i].indexOf(kept) + kept.length + ); } }) ); diff --git a/src/test/merge.test.ts b/src/test/merge.test.ts index b8070c00a..60604bb63 100644 --- a/src/test/merge.test.ts +++ b/src/test/merge.test.ts @@ -25,7 +25,7 @@ describe("Merging projects", () => { app.logger = logger; const project = app.convert(); - logger.expectNoOtherMessages() + logger.expectNoOtherMessages(); equal(project?.name, "typedoc"); equal(