Skip to content

Commit

Permalink
chore: remove undocumented filePathsToIgnore option
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jun 26, 2024
1 parent 6e64abd commit f022c7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 6 additions & 12 deletions packages/svelte-check/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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 (
Expand Down
2 changes: 0 additions & 2 deletions packages/svelte-check/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface SvelteCheckCliOptions {
watch: boolean;
preserveWatchOutput: boolean;
tsconfig?: string;
filePathsToIgnore: string[];
failOnWarnings: boolean;
compilerWarnings: Record<string, 'error' | 'ignore'>;
diagnosticSources: DiagnosticSource[];
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit f022c7e

Please sign in to comment.