Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy authored and alcuadrado committed Oct 22, 2024
1 parent d363318 commit aaeaecd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 3 additions & 1 deletion packages/hardhat-core/src/builtin-tasks/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,9 @@ subtask(TASK_COMPILE_SOLIDITY_LOG_COMPILATION_ERRORS)
getFormattedInternalCompilerErrorMessage(error) ??
error.formattedMessage;

console.error(errorMessage.replace(/^\w+:/, (t) => chalk.bold(chalk.red(t))));
console.error(
errorMessage.replace(/^\w+:/, (t) => chalk.bold(chalk.red(t)))
);
} else {
console.warn(
(error.formattedMessage as string).replace(/^\w+:/, (t) =>
Expand Down
16 changes: 9 additions & 7 deletions packages/hardhat-core/src/internal/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,16 @@ async function main() {

// Warning for Hardhat V3 deprecation
console.warn(
chalk.yellow.bold("\n\nDEPRECATION WARNING\n\n"),
chalk.bold(chalk.yellow("\n\nDEPRECATION WARNING\n\n")),
chalk.yellow(
`Initializing a project with ${chalk.white.italic(
"npx hardhat"
`Initializing a project with ${chalk.italic(
chalk.white("npx hardhat")
)} is deprecated and will be removed in the future.\n`
),
chalk.yellow(
`Please use ${chalk.white.italic("npx hardhat init")} instead.\n\n`
`Please use ${chalk.italic(
chalk.white("npx hardhat init")
)} instead.\n\n`
)
);

Expand Down Expand Up @@ -387,13 +389,13 @@ async function main() {
if (HardhatError.isHardhatError(error)) {
isHardhatError = true;
console.error(
chalk.red.bold("Error"),
error.message.replace(/^\w+:/, (t) => chalk.red.bold(t))
chalk.bold(chalk.red("Error")),
error.message.replace(/^\w+:/, (t) => chalk.bold(chalk.red(t)))
);
} else if (HardhatPluginError.isHardhatPluginError(error)) {
isHardhatError = true;
console.error(
chalk.red.bold(`Error in plugin ${error.pluginName}:`),
chalk.bold(chalk.red(`Error in plugin ${error.pluginName}:`)),
error.message
);
} else if (error instanceof Error) {
Expand Down
7 changes: 5 additions & 2 deletions packages/hardhat-core/src/internal/util/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function glob(
pattern: string,
options: GlobOptions = {}
): Promise<string[]> {
const files = await (await import('tinyglobby')).glob([pattern], options);
const files = await (await import("tinyglobby")).glob([pattern], options);
return files.map(path.normalize);
}

Expand All @@ -23,6 +23,9 @@ export async function glob(
* @see glob
*/
export function globSync(pattern: string, options: GlobOptions = {}): string[] {
const files = (require('tinyglobby') as typeof import('tinyglobby')).globSync([pattern], options);
const files = (require("tinyglobby") as typeof import("tinyglobby")).globSync(
[pattern],
options
);
return files.map(path.normalize);
}

0 comments on commit aaeaecd

Please sign in to comment.