mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
14 lines
363 B
TypeScript
14 lines
363 B
TypeScript
import type { LayeringViolation } from './model.ts';
|
|
|
|
export function retiredPathViolations(
|
|
files: readonly string[],
|
|
root: string,
|
|
rule: string,
|
|
message: string,
|
|
): LayeringViolation[] {
|
|
const prefix = `${root}/`;
|
|
return files
|
|
.filter((file) => file === root || file.startsWith(prefix))
|
|
.map((file) => ({ rule, file, line: 1, message }));
|
|
}
|