MCPcopy Create free account
hub / github.com/code-pushup/cli / isRecommended

Function isRecommended

packages/plugin-eslint/src/lib/binding.ts:133–146  ·  view source on GitHub ↗
(targetDir: string)

Source from the content-addressed store, hash-verified

131}
132
133async function isRecommended(targetDir: string): Promise<boolean> {
134 if (await detectEslintConfig(targetDir)) {
135 return true;
136 }
137 try {
138 const packageJson = await readJsonFile<{
139 dependencies?: Record<string, string>;
140 devDependencies?: Record<string, string>;
141 }>(path.join(targetDir, 'package.json'));
142 return hasDependency(packageJson, 'eslint');
143 } catch {
144 return false;
145 }
146}
147
148async function detectEslintConfig(
149 targetDir: string,

Callers 1

detectRecommendedFunction · 0.50

Calls 2

hasDependencyFunction · 0.90
detectEslintConfigFunction · 0.85

Tested by

no test coverage detected