(packageName: string)
| 42 | ] |
| 43 | |
| 44 | function isKnownDevDependencyPackage(packageName: string): boolean { |
| 45 | const normalized = packageName.toLowerCase() |
| 46 | if (normalized.startsWith('@types/')) { |
| 47 | return true |
| 48 | } |
| 49 | // Match scoped packages by name segment, e.g. @scope/eslint-config |
| 50 | const namePart = normalized.includes('/') ? normalized.split('/').pop() : normalized |
| 51 | if (!namePart) return false |
| 52 | |
| 53 | return ( |
| 54 | KNOWN_DEV_DEPENDENCY_PACKAGES.has(normalized) || |
| 55 | KNOWN_DEV_DEPENDENCY_PACKAGES.has(namePart) || |
| 56 | KNOWN_DEV_DEPENDENCY_PACKAGE_PREFIXES.some(prefix => |
| 57 | prefix.startsWith('@') ? normalized.startsWith(prefix) : namePart.startsWith(prefix), |
| 58 | ) |
| 59 | ) |
| 60 | } |
| 61 | |
| 62 | function escapeRegExp(text: string): string { |
| 63 | return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') |
no outgoing calls
no test coverage detected