We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2cea3b commit 79bbde7Copy full SHA for 79bbde7
packages/typescript-plugin/src/index.ts
@@ -66,7 +66,15 @@ function init(modules: { typescript: typeof ts }) {
66
(!compilerOptions.jsxFactory || compilerOptions.jsxFactory.startsWith('svelte')) &&
67
!compilerOptions.jsxFragmentFactory &&
68
!compilerOptions.jsxImportSource;
69
- return isNoJsxProject;
+ try {
70
+ const isSvelteProject =
71
+ typeof compilerOptions.configFilePath !== 'string' ||
72
+ require.resolve('svelte', { paths: [compilerOptions.configFilePath] });
73
+ return isNoJsxProject && isSvelteProject;
74
+ } catch (e) {
75
+ // If require.resolve fails, we end up here
76
+ return false;
77
+ }
78
}
79
80
return { create, getExternalFiles };
0 commit comments