(targetDir: string)
| 131 | } |
| 132 | |
| 133 | async 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 | |
| 148 | async function detectEslintConfig( |
| 149 | targetDir: string, |
no test coverage detected