Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove undocumented filePathsToIgnore option #2420

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions packages/svelte-check/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ type Result = {
fileCountWithProblems: number;
};

async function openAllDocuments(
workspaceUri: URI,
filePathsToIgnore: string[],
svelteCheck: SvelteCheck
) {
async function openAllDocuments(workspaceUri: URI, svelteCheck: SvelteCheck) {
// TODO: replace glob with smaller implementation
const files = await glob('**/*.svelte', {
benmccann marked this conversation as resolved.
Show resolved Hide resolved
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 +107,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 +194,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
Loading