(filePath: string)
| 9 | const PATTERN = /#packages\// |
| 10 | |
| 11 | export function checkFile(filePath: string): string[] { |
| 12 | const content = readFileSync(filePath, 'utf8') |
| 13 | const errors: string[] = [] |
| 14 | const lines = content.split('\n') |
| 15 | for (let i = 0; i < lines.length; i++) { |
| 16 | if (PATTERN.test(lines[i])) { |
| 17 | errors.push(`${filePath}:${i + 1}: ${lines[i].trim()}`) |
| 18 | } |
| 19 | } |
| 20 | return errors |
| 21 | } |
| 22 | |
| 23 | export function checkPath(targetPath: string): string[] { |
| 24 | const stat = statSync(targetPath, {throwIfNoEntry: false}) |