diff --git a/website/src/playground/Playground.tsx b/website/src/playground/Playground.tsx index ba30827228b..d8f7a9a21c1 100644 --- a/website/src/playground/Playground.tsx +++ b/website/src/playground/Playground.tsx @@ -1,6 +1,4 @@ -import { - emptyPrettierOutput, - emptyRomeOutput, +import type { PlaygroundProps, RomeAstSyntacticData, } from "./types"; diff --git a/website/src/playground/tabs/SettingsTab.tsx b/website/src/playground/tabs/SettingsTab.tsx index acba54cef98..9bdec3e5d2f 100644 --- a/website/src/playground/tabs/SettingsTab.tsx +++ b/website/src/playground/tabs/SettingsTab.tsx @@ -1,6 +1,5 @@ import { IndentStyle, - PlaygroundSettings, PlaygroundState, QuoteProperties, QuoteStyle, diff --git a/website/src/playground/workers/prettierWorker.ts b/website/src/playground/workers/prettierWorker.ts index 7b5facfc83f..a74eaeb7608 100644 --- a/website/src/playground/workers/prettierWorker.ts +++ b/website/src/playground/workers/prettierWorker.ts @@ -1,4 +1,4 @@ -import { formatWithPrettier } from "../utils"; +import { formatWithPrettier, isTypeScriptFilename } from "../utils"; import { defaultPlaygroundState, PlaygroundSettings } from "../types"; let settings = defaultPlaygroundState.settings; @@ -17,7 +17,6 @@ self.addEventListener("message", (e) => { indentWidth, quoteStyle, quoteProperties, - typescript: isTypeScript, trailingComma, } = settings; const code = e.data.code as string; @@ -27,7 +26,7 @@ self.addEventListener("message", (e) => { lineWidth, indentStyle, indentWidth, - language: isTypeScript ? "ts" : "js", + language: isTypeScriptFilename(filename) ? "ts" : "js", quoteStyle, quoteProperties, trailingComma, diff --git a/website/src/playground/workers/romeWorker.ts b/website/src/playground/workers/romeWorker.ts index ba44405607a..6b095c37293 100644 --- a/website/src/playground/workers/romeWorker.ts +++ b/website/src/playground/workers/romeWorker.ts @@ -9,11 +9,9 @@ import { IndentStyle, LoadingState, PlaygroundSettings, - PlaygroundState, QuoteProperties, QuoteStyle, RomeOutput, - SourceType, } from "../types"; let workspace: Workspace | null = null; @@ -30,7 +28,7 @@ const files: Map = new Map(); let configuration: undefined | Configuration; -function getPathForFile(file: File) { +function getPathForFile(file: File): RomePath { return { path: file.filename, id: file.id,