fix: correctly detect JS projects with type checking

This commit is contained in:
Ben McCann 2023-02-05 14:52:37 -08:00
parent 293d52cbb8
commit 3adfd73c95

View File

@ -1,4 +1,3 @@
import path from 'path';
import fs from 'fs';
import findUp from 'find-up';
import semver from 'semver';
@ -85,7 +84,7 @@ const getFrameworkPreset = (
}
if (Array.isArray(files) && files.length > 0) {
matcher.files = files.map((name) => fs.existsSync(path.join(process.cwd(), name)));
matcher.files = files.map((name) => fs.existsSync(name));
}
return matcherFunction(matcher) ? preset : null;
@ -151,7 +150,7 @@ export function isStorybookInstalled(
export function detectLanguage(packageJson?: PackageJson) {
let language = SupportedLanguage.JAVASCRIPT;
if (!packageJson) {
if (!packageJson || fs.existsSync('jsconfig.json')) {
return language;
}