Skip to content

Commit

Permalink
Update type
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderdeseyn committed Oct 30, 2020
1 parent ed90140 commit 98e1cee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ extendConfig(
};
}
}),
directories: w.directories ?? [config.paths.sources],
files: w.files ?? [config.paths.sources],
verbose: w.verbose ?? false,
};
}
);

task("watch", "Start the file watcher").setAction(
async ({}, { run, tasks, config: { watcher } }) => {
console.log("Starting file watcher", watcher.directories);
console.log("Starting file watcher", watcher.files);

// Validate tasks
watcher.tasks.forEach((task) => {
Expand All @@ -45,7 +45,7 @@ task("watch", "Start the file watcher").setAction(
});

chokidar
.watch(watcher.directories)
.watch(watcher.files)
.on("change", async () => {
for (let i = 0; i < watcher.tasks.length; i++) {
const task = watcher.tasks[i];
Expand Down
4 changes: 2 additions & 2 deletions src/type-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare module "hardhat/types/config" {
export interface HardhatUserConfig {
watcher?: {
tasks?: WatcherTask[];
directories?: string[];
files?: string[];
verbose?: boolean;
};
}
Expand All @@ -24,7 +24,7 @@ declare module "hardhat/types/config" {
export interface HardhatConfig {
watcher: {
tasks: Required<ExpandedWatcherTask>[];
directories: string[];
files: string[];
verbose: boolean;
};
}
Expand Down

0 comments on commit 98e1cee

Please sign in to comment.