From 28ff4faf50781d7e7c3c9b1175994579461c5003 Mon Sep 17 00:00:00 2001 From: Travis Arnold Date: Tue, 1 Oct 2024 22:01:24 -0700 Subject: [PATCH] run prettier --- packages/renoun/src/utils/analyze-source-text.ts | 2 +- .../renoun/src/utils/extract-export-by-identifier.ts | 7 ++++--- packages/renoun/src/utils/get-declaration-location.ts | 2 +- packages/renoun/src/utils/get-diagnostic-message.ts | 2 +- .../renoun/src/utils/get-directory-source-file.ts | 2 +- packages/renoun/src/utils/get-exported-declaration.ts | 1 + .../renoun/src/utils/get-source-files-path-map.ts | 2 +- packages/renoun/src/utils/get-tokens.ts | 7 ++++--- .../renoun/src/utils/get-trimmed-source-file-text.ts | 2 +- packages/renoun/src/utils/resolve-expressions.ts | 11 ++++++++--- packages/renoun/src/utils/resolve-type.ts | 1 + 11 files changed, 24 insertions(+), 15 deletions(-) diff --git a/packages/renoun/src/utils/analyze-source-text.ts b/packages/renoun/src/utils/analyze-source-text.ts index 4374f928..a84f10fd 100644 --- a/packages/renoun/src/utils/analyze-source-text.ts +++ b/packages/renoun/src/utils/analyze-source-text.ts @@ -2,7 +2,7 @@ import { getTokens } from './get-tokens.js' import type { createHighlighter } from './create-highlighter.js' import type { ParseMetadataOptions } from './parse-source-text-metadata.js' import { parseSourceTextMetadata } from './parse-source-text-metadata.js' -import type { Project } from "ts-morph"; +import type { Project } from 'ts-morph' export type AnalyzeSourceTextOptions = ParseMetadataOptions & { project: Project diff --git a/packages/renoun/src/utils/extract-export-by-identifier.ts b/packages/renoun/src/utils/extract-export-by-identifier.ts index a571dd33..5ff9c01d 100644 --- a/packages/renoun/src/utils/extract-export-by-identifier.ts +++ b/packages/renoun/src/utils/extract-export-by-identifier.ts @@ -1,6 +1,7 @@ -import type { SourceFile } from "ts-morph"; -import tsMorph from "ts-morph"; -const { Node, ts } = tsMorph; +import type { SourceFile } from 'ts-morph' +import tsMorph from 'ts-morph' + +const { Node, ts } = tsMorph /** Extract a single export and its local dependencies from a source file. */ export function extractExportByIdentifier( diff --git a/packages/renoun/src/utils/get-declaration-location.ts b/packages/renoun/src/utils/get-declaration-location.ts index e716f03a..a516e626 100644 --- a/packages/renoun/src/utils/get-declaration-location.ts +++ b/packages/renoun/src/utils/get-declaration-location.ts @@ -1,4 +1,4 @@ -import type { Node, Project } from "ts-morph"; +import type { Node, Project } from 'ts-morph' /** The start and and position of the declaration in the file. */ export type DeclarationPosition = { diff --git a/packages/renoun/src/utils/get-diagnostic-message.ts b/packages/renoun/src/utils/get-diagnostic-message.ts index 1e6f43d9..f600dd84 100644 --- a/packages/renoun/src/utils/get-diagnostic-message.ts +++ b/packages/renoun/src/utils/get-diagnostic-message.ts @@ -1,4 +1,4 @@ -import type { DiagnosticMessageChain } from "ts-morph"; +import type { DiagnosticMessageChain } from 'ts-morph' /** Parses a diagnostic message into a string. */ export function getDiagnosticMessageText( diff --git a/packages/renoun/src/utils/get-directory-source-file.ts b/packages/renoun/src/utils/get-directory-source-file.ts index 597207ae..cf79e4ce 100644 --- a/packages/renoun/src/utils/get-directory-source-file.ts +++ b/packages/renoun/src/utils/get-directory-source-file.ts @@ -1,4 +1,4 @@ -import type { Directory, SourceFile } from "ts-morph"; +import type { Directory, SourceFile } from 'ts-morph' const indexFileNames = [ 'js', diff --git a/packages/renoun/src/utils/get-exported-declaration.ts b/packages/renoun/src/utils/get-exported-declaration.ts index ec9f8b20..23ea040b 100644 --- a/packages/renoun/src/utils/get-exported-declaration.ts +++ b/packages/renoun/src/utils/get-exported-declaration.ts @@ -1,5 +1,6 @@ import type { ExportedDeclarations } from 'ts-morph' import tsMorph from 'ts-morph' + const { Node } = tsMorph /** Unwraps exported declarations from a source file. */ diff --git a/packages/renoun/src/utils/get-source-files-path-map.ts b/packages/renoun/src/utils/get-source-files-path-map.ts index ccbd1ad2..6f32f19e 100644 --- a/packages/renoun/src/utils/get-source-files-path-map.ts +++ b/packages/renoun/src/utils/get-source-files-path-map.ts @@ -1,5 +1,5 @@ import { filePathToPathname } from '../utils/file-path-to-pathname.js' -import type { Directory } from "ts-morph"; +import type { Directory } from 'ts-morph' /** Returns a map of source file paths to their pathname. */ export function getSourcePathMap( diff --git a/packages/renoun/src/utils/get-tokens.ts b/packages/renoun/src/utils/get-tokens.ts index a7d537eb..bc4116c6 100644 --- a/packages/renoun/src/utils/get-tokens.ts +++ b/packages/renoun/src/utils/get-tokens.ts @@ -9,9 +9,10 @@ import { generatedFilenames } from './parse-source-text-metadata.js' import type { Highlighter } from './create-highlighter.js' import { getTrimmedSourceFileText } from './get-trimmed-source-file-text.js' import { splitTokenByRanges } from './split-tokens-by-ranges.js' -import type { Diagnostic, Project, SourceFile, ts } from "ts-morph"; -import tsMorph from "ts-morph"; -const { Node, SyntaxKind } = tsMorph; +import type { Diagnostic, Project, SourceFile, ts } from 'ts-morph' +import tsMorph from 'ts-morph' + +const { Node, SyntaxKind } = tsMorph export const languageMap = { mjs: 'js', diff --git a/packages/renoun/src/utils/get-trimmed-source-file-text.ts b/packages/renoun/src/utils/get-trimmed-source-file-text.ts index fa63ab1c..0a5fac39 100644 --- a/packages/renoun/src/utils/get-trimmed-source-file-text.ts +++ b/packages/renoun/src/utils/get-trimmed-source-file-text.ts @@ -1,4 +1,4 @@ -import type { SourceFile } from "ts-morph"; +import type { SourceFile } from 'ts-morph' /** Trims empty export statements added when coercing source text into module. */ export function getTrimmedSourceFileText(sourceFile: SourceFile) { diff --git a/packages/renoun/src/utils/resolve-expressions.ts b/packages/renoun/src/utils/resolve-expressions.ts index 916471de..6b5e8aab 100644 --- a/packages/renoun/src/utils/resolve-expressions.ts +++ b/packages/renoun/src/utils/resolve-expressions.ts @@ -1,6 +1,11 @@ -import type { ArrayLiteralExpression, Expression, ObjectLiteralExpression } from "ts-morph"; -import tsMorph from "ts-morph"; -const { Node } = tsMorph; +import type { + ArrayLiteralExpression, + Expression, + ObjectLiteralExpression, +} from 'ts-morph' +import tsMorph from 'ts-morph' + +const { Node } = tsMorph export type LiteralExpressionValue = | undefined diff --git a/packages/renoun/src/utils/resolve-type.ts b/packages/renoun/src/utils/resolve-type.ts index f817e84c..2fa2b98e 100644 --- a/packages/renoun/src/utils/resolve-type.ts +++ b/packages/renoun/src/utils/resolve-type.ts @@ -21,6 +21,7 @@ import type { Node, } from 'ts-morph' import tsMorph from 'ts-morph' + const { SyntaxKind, TypeFormatFlags } = tsMorph export interface BaseType {