(file: string)
| 825 | return candidates |
| 826 | .sort((a, b) => { |
| 827 | const score = (file: string): number => { |
| 828 | const lower = file.toLowerCase(); |
| 829 | if (lower === DEFAULT_SOURCE_ENTRY.toLowerCase()) return 0; |
| 830 | if (lower === LEGACY_SOURCE_ENTRY.toLowerCase()) return 1; |
| 831 | if (lower.endsWith('/app.jsx') || lower.endsWith('/app.tsx')) return 2; |
| 832 | if (lower.endsWith('/index.html')) return 3; |
| 833 | return 10; |
| 834 | }; |
| 835 | return score(a) - score(b) || a.localeCompare(b); |
| 836 | }) |
| 837 | .slice(0, 8); |