From f022c7e8d40e77bca496da538de5daae381fba85 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:19:14 -0700 Subject: [PATCH] chore: remove undocumented filePathsToIgnore option --- packages/svelte-check/src/index.ts | 18 ++++++------------ packages/svelte-check/src/options.ts | 2 -- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/svelte-check/src/index.ts b/packages/svelte-check/src/index.ts index 6e64414ed..ee76e1e5e 100644 --- a/packages/svelte-check/src/index.ts +++ b/packages/svelte-check/src/index.ts @@ -25,14 +25,10 @@ type Result = { fileCountWithProblems: number; }; -async function openAllDocuments( - workspaceUri: URI, - filePathsToIgnore: string[], - svelteCheck: SvelteCheck -) { +async function openAllDocuments(workspaceUri: URI, svelteCheck: SvelteCheck) { const files = await glob('**/*.svelte', { cwd: workspaceUri.fsPath, - ignore: ['node_modules/**'].concat(filePathsToIgnore.map((ignore) => `${ignore}/**`)) + ignore: ['node_modules/**'] }); const absFilePaths = files.map((f) => path.resolve(workspaceUri.fsPath, f)); @@ -110,13 +106,12 @@ class DiagnosticsWatcher { private workspaceUri: URI, private svelteCheck: SvelteCheck, private writer: Writer, - filePathsToIgnore: string[], ignoreInitialAdd: boolean ) { watch(`${workspaceUri.fsPath}/**/*.{svelte,d.ts,ts,js,jsx,tsx,mjs,cjs,mts,cts}`, { - ignored: ['node_modules', 'vite.config.{js,ts}.timestamp-*'] - .concat(filePathsToIgnore) - .map((ignore) => path.join(workspaceUri.fsPath, ignore)), + ignored: ['node_modules', 'vite.config.{js,ts}.timestamp-*'].map((ignore) => + path.join(workspaceUri.fsPath, ignore) + ), ignoreInitial: ignoreInitialAdd }) .on('add', (path) => this.updateDocument(path, true)) @@ -198,14 +193,13 @@ parseOptions(async (opts) => { opts.workspaceUri, new SvelteCheck(opts.workspaceUri.fsPath, svelteCheckOptions), writer, - opts.filePathsToIgnore, !!opts.tsconfig ); } else { const svelteCheck = new SvelteCheck(opts.workspaceUri.fsPath, svelteCheckOptions); if (!opts.tsconfig) { - await openAllDocuments(opts.workspaceUri, opts.filePathsToIgnore, svelteCheck); + await openAllDocuments(opts.workspaceUri, svelteCheck); } const result = await getDiagnostics(opts.workspaceUri, writer, svelteCheck); if ( diff --git a/packages/svelte-check/src/options.ts b/packages/svelte-check/src/options.ts index bf270e3c4..0123b2305 100644 --- a/packages/svelte-check/src/options.ts +++ b/packages/svelte-check/src/options.ts @@ -9,7 +9,6 @@ export interface SvelteCheckCliOptions { watch: boolean; preserveWatchOutput: boolean; tsconfig?: string; - filePathsToIgnore: string[]; failOnWarnings: boolean; compilerWarnings: Record; diagnosticSources: DiagnosticSource[]; @@ -73,7 +72,6 @@ export function parseOptions(cb: (opts: SvelteCheckCliOptions) => any) { watch: !!opts.watch, preserveWatchOutput: !!opts.preserveWatchOutput, tsconfig: getTsconfig(opts, workspaceUri.fsPath), - filePathsToIgnore: getFilepathsToIgnore(opts), failOnWarnings: !!opts['fail-on-warnings'], compilerWarnings: getCompilerWarnings(opts), diagnosticSources: getDiagnosticSources(opts),