Skip to content

Commit 4c200ba

Browse files
authored
(fix) recognize more js-like file types for svelte-check (#1894)
#1827
1 parent 69336d0 commit 4c200ba

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/language-server/src/svelte-check.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,16 @@ export class SvelteCheck {
114114
}
115115
}
116116

117-
if (doc.uri.endsWith('.ts') || doc.uri.endsWith('.js')) {
117+
if (
118+
doc.uri.endsWith('.ts') ||
119+
doc.uri.endsWith('.js') ||
120+
doc.uri.endsWith('.tsx') ||
121+
doc.uri.endsWith('.jsx') ||
122+
doc.uri.endsWith('.mjs') ||
123+
doc.uri.endsWith('.cjs') ||
124+
doc.uri.endsWith('.mts') ||
125+
doc.uri.endsWith('.cts')
126+
) {
118127
this.pluginHost.updateTsOrJsFile(filePath, [
119128
{
120129
range: Range.create(

packages/svelte-check/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class DiagnosticsWatcher {
9898
filePathsToIgnore: string[],
9999
ignoreInitialAdd: boolean
100100
) {
101-
watch(`${workspaceUri.fsPath}/**/*.{svelte,d.ts,ts,js}`, {
101+
watch(`${workspaceUri.fsPath}/**/*.{svelte,d.ts,ts,js,jsx,tsx,mjs,cjs,mts,cts}`, {
102102
ignored: ['node_modules']
103103
.concat(filePathsToIgnore)
104104
.map((ignore) => path.join(workspaceUri.fsPath, ignore)),

0 commit comments

Comments
 (0)