MCPcopy
hub / github.com/formatjs/formatjs / checkFile

Function checkFile

tools/check_no_internal_imports.ts:11–21  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

9const PATTERN = /#packages\//
10
11export 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
23export function checkPath(targetPath: string): string[] {
24 const stat = statSync(targetPath, {throwIfNoEntry: false})

Callers 1

checkPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected