Skip to content

Commit 32b9d1d

Browse files
committed
Cleanup
1 parent 8c91547 commit 32b9d1d

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

v-next/example-project/hardhat.config.ts

+24-24
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,29 @@ const greeting = task("hello", "Prints a greeting")
9595
})
9696
.build();
9797

98+
const pluginExample = {
99+
id: "community-plugin",
100+
tasks: [
101+
task("plugin-hello", "Prints a greeting from community-plugin")
102+
.addOption({
103+
name: "greeting",
104+
description: "The greeting to print",
105+
defaultValue: "Hello, World from community-plugin!",
106+
})
107+
.setAction(async ({ greeting }, _) => {
108+
console.log(greeting);
109+
110+
if (greeting === "") {
111+
throw new HardhatPluginError(
112+
"community-plugin",
113+
"Greeting cannot be empty",
114+
);
115+
}
116+
})
117+
.build(),
118+
],
119+
};
120+
98121
export default {
99122
tasks: [
100123
exampleTaskOverride,
@@ -105,29 +128,6 @@ export default {
105128
exampleEmptySubtask,
106129
greeting,
107130
],
108-
plugins: [
109-
{
110-
id: "plugin-example",
111-
tasks: [
112-
task("plugin1-hello", "Prints a greeting from plugin1")
113-
.addOption({
114-
name: "greeting",
115-
description: "The greeting to print",
116-
defaultValue: "Hello, World from plugin1!",
117-
})
118-
.setAction(async ({ greeting }, _) => {
119-
console.log(greeting);
120-
121-
if (greeting === "") {
122-
throw new HardhatPluginError(
123-
"plugin-example",
124-
"Greeting cannot be empty",
125-
);
126-
}
127-
})
128-
.build(),
129-
],
130-
},
131-
],
131+
plugins: [pluginExample],
132132
privateKey: configVariable("privateKey"),
133133
} satisfies HardhatUserConfig;

0 commit comments

Comments
 (0)