( dir: string, skipSubpaths: readonly string[] = TESTS_LINT_META_SKIP )
| 28 | } |
| 29 | |
| 30 | export function collectSourceFiles( |
| 31 | dir: string, |
| 32 | skipSubpaths: readonly string[] = TESTS_LINT_META_SKIP |
| 33 | ): string[] { |
| 34 | const out: string[] = []; |
| 35 | let entries: string[]; |
| 36 | |
| 37 | try { |
| 38 | entries = readdirSync(dir); |
| 39 | } catch { |
| 40 | return out; |
| 41 | } |
| 42 | |
| 43 | for (const entry of entries) { |
| 44 | const full = join(dir, entry); |
| 45 | const stat = statSync(full); |
| 46 | |
| 47 | if (stat.isDirectory()) { |
| 48 | if (shouldSkipDirectory(full, skipSubpaths)) { |
| 49 | continue; |
| 50 | } |
| 51 | |
| 52 | out.push(...collectSourceFiles(full, skipSubpaths)); |
| 53 | continue; |
| 54 | } |
| 55 | |
| 56 | if (stat.isFile() && SOURCE_EXTENSIONS.has(extname(full))) { |
| 57 | out.push(full); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | return out; |
| 62 | } |
| 63 | |
| 64 | export function findWorkflows(dir: string): string[] { |
| 65 | const out: string[] = []; |
no test coverage detected