Skip to content

Commit 22abbd5

Browse files
committed
Fix type error
1 parent 0eca4fa commit 22abbd5

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

v-next/core/src/internal/global-options.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ export function resolveGlobalOptions(
156156
parsedValue = option.defaultValue;
157157
}
158158

159-
globalOptions[name] = parsedValue;
159+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
160+
-- GlobalOptions is empty for user extension, so we need to cast it to
161+
assign the value. */
162+
(globalOptions as Record<string, ParameterValue>)[name] = parsedValue;
160163
}
161164

162165
return globalOptions;

v-next/core/src/types/global-options.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import type {
2-
ParameterType,
3-
ParameterTypeToValueType,
4-
ParameterValue,
5-
} from "./common.js";
1+
import type { ParameterType, ParameterTypeToValueType } from "./common.js";
62

73
/**
84
* A global option with an associated value and a default if not provided by
@@ -29,7 +25,7 @@ export interface GlobalOption<T extends ParameterType = ParameterType> {
2925
* Runtime Environment.
3026
*/
3127
// eslint-disable-next-line @typescript-eslint/no-empty-interface -- To be used through module augmentation
32-
export interface GlobalOptions extends Record<string, ParameterValue> {}
28+
export interface GlobalOptions {}
3329

3430
/**
3531
* An entry in the global options map.

v-next/hardhat/src/internal/cli/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function parseDoubleDashArgs(
378378
cliArguments: string[],
379379
usedCliArguments: boolean[],
380380
optionsMap: Map<string, TaskOption | GlobalOption>,
381-
argumentsMap: TaskArguments | Partial<GlobalOptions>,
381+
argumentsMap: TaskArguments,
382382
ignoreUnknownParameter = false,
383383
) {
384384
for (let i = 0; i < cliArguments.length; i++) {
@@ -525,7 +525,7 @@ function parsePositionalAndVariadicParameters(
525525

526526
function validateRequiredParameters(
527527
parameters: TaskParameter[],
528-
taskArguments: TaskArguments | Partial<GlobalOptions>,
528+
taskArguments: TaskArguments,
529529
) {
530530
const missingRequiredParam = parameters.find(
531531
(param) =>

0 commit comments

Comments
 (0)