Skip to content

Commit

Permalink
(fix) recognize more js-like file types for svelte-check (#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Feb 23, 2023
1 parent 69336d0 commit 4c200ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/language-server/src/svelte-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,16 @@ export class SvelteCheck {
}
}

if (doc.uri.endsWith('.ts') || doc.uri.endsWith('.js')) {
if (
doc.uri.endsWith('.ts') ||
doc.uri.endsWith('.js') ||
doc.uri.endsWith('.tsx') ||
doc.uri.endsWith('.jsx') ||
doc.uri.endsWith('.mjs') ||
doc.uri.endsWith('.cjs') ||
doc.uri.endsWith('.mts') ||
doc.uri.endsWith('.cts')
) {
this.pluginHost.updateTsOrJsFile(filePath, [
{
range: Range.create(
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-check/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class DiagnosticsWatcher {
filePathsToIgnore: string[],
ignoreInitialAdd: boolean
) {
watch(`${workspaceUri.fsPath}/**/*.{svelte,d.ts,ts,js}`, {
watch(`${workspaceUri.fsPath}/**/*.{svelte,d.ts,ts,js,jsx,tsx,mjs,cjs,mts,cts}`, {
ignored: ['node_modules']
.concat(filePathsToIgnore)
.map((ignore) => path.join(workspaceUri.fsPath, ignore)),
Expand Down

0 comments on commit 4c200ba

Please sign in to comment.