typescript-svelte-plugin
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -10,3 +10,3 @@ "use strict"; | ||
const logger = new logger_1.Logger(info.project.projectService.logger); | ||
if (!isSvelteProject(info)) { | ||
if (!isSvelteProject(info.project.getCompilerOptions())) { | ||
logger.log('Detected that this is not a Svelte project, abort patching TypeScript'); | ||
@@ -22,2 +22,5 @@ return info.languageService; | ||
function getExternalFiles(project) { | ||
if (!isSvelteProject(project.getCompilerOptions())) { | ||
return []; | ||
} | ||
// Needed so the ambient definitions are known inside the tsx files | ||
@@ -45,5 +48,4 @@ const svelteTsPath = (0, path_1.dirname)(require.resolve('svelte2tsx')); | ||
} | ||
function isSvelteProject(info) { | ||
function isSvelteProject(compilerOptions) { | ||
// Add more checks like "no Svelte file found" or "no config file found"? | ||
const compilerOptions = info.project.getCompilerOptions(); | ||
const isNoJsxProject = (!compilerOptions.jsx || compilerOptions.jsx === modules.typescript.JsxEmit.Preserve) && | ||
@@ -50,0 +52,0 @@ (!compilerOptions.jsxFactory || compilerOptions.jsxFactory.startsWith('svelte')) && |
{ | ||
"name": "typescript-svelte-plugin", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "A TypeScript Plugin providing Svelte intellisense", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48187
1089