au-rogue
Version:
Conservative Aurelia 1 to 2 codemods. Changes only what is safe, reports everything.
29 lines (28 loc) • 842 B
TypeScript
export type ChangeKind = 'edit' | 'add' | 'remove' | 'warn' | 'note';
export interface ChangeEntry {
file: string;
kind: ChangeKind;
message: string;
loc?: {
line?: number;
col?: number;
};
before?: string;
after?: string;
}
export interface ReportData {
startedAt: string;
finishedAt?: string;
options: Record<string, any>;
entries: ChangeEntry[];
}
export declare class Reporter {
data: ReportData;
constructor(options: Record<string, any>);
edit(file: string, message: string, before?: string, after?: string): void;
warn(file: string, message: string): void;
note(file: string, message: string): void;
add(file: string, message: string, after?: string): void;
remove(file: string, message: string, before?: string): void;
finish(): ReportData;
}