UNPKG

@adguard/aglint

Version:

Universal adblock filter list linter.

30 lines (29 loc) 1.08 kB
import { type ParsedPath } from 'path'; import { type ScannedDirectory } from './scan'; import { type LinterConfig } from '../common'; /** * An event that is performed on a file or directory. * * @param path The path of the file or directory * @param config The active linter config * @param fix Fix fixable problems automatically */ export type WalkEvent = (path: ParsedPath, config: LinterConfig, fix: boolean) => Promise<void>; /** * An object containing the events to be performed on each file and directory. */ interface WalkEvents { file: WalkEvent; dir?: WalkEvent; } /** * Walks a `ScannedDirectory` object and performs an action on each file and directory * in the tree. * * @param scannedDirectory The `ScannedDirectory` object to be walked * @param events The events to be performed on each file and directory * @param config The CLI config * @param fix Fix fixable problems automatically */ export declare function walk(scannedDirectory: ScannedDirectory, events: WalkEvents, config: LinterConfig, fix?: boolean): Promise<void>; export {};