CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-confusing-browser-globals

A curated list of browser globals that commonly cause confusion and are not recommended to use without an explicit window qualifier

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-4/

Webpack Build Reporter

Create a build status reporter that displays formatted webpack compilation results to users in a clean, readable format.

Requirements

Your task is to create a reporter that processes webpack compilation statistics and displays formatted error and warning messages. The reporter should:

  1. Accept webpack stats objects from a compilation
  2. Format any errors and warnings for display
  3. Display formatted messages to the console with appropriate severity labels
  4. Return a summary object indicating if the build succeeded (no errors)

Expected Behavior

  • If there are errors, display "Failed to compile." followed by formatted error messages
  • If there are only warnings, display "Compiled with warnings." followed by formatted warning messages
  • If there are no errors or warnings, display "Compiled successfully."
  • Each message should be cleanly formatted and easy to read

Test Cases

  • Given webpack stats with no errors or warnings, it returns success status and prints "Compiled successfully." @test

  • Given webpack stats with errors, it formats and displays the errors with "Failed to compile." header @test

  • Given webpack stats with only warnings, it formats and displays warnings with "Compiled with warnings." header @test

@generates

API

/**
 * Processes webpack stats and reports formatted build results
 * @param {Object} stats - Webpack stats object with errors and warnings arrays
 * @returns {{ success: boolean, hasWarnings: boolean }} Build status summary
 */
function reportBuildStatus(stats) {
  // Implementation
}

module.exports = { reportBuildStatus };

Dependencies { .dependencies }

react-dev-utils { .dependency }

Provides utilities for formatting webpack messages and enhancing developer experience in React applications.

Install with Tessl CLI

npx tessl i tessl/npm-confusing-browser-globals

tile.json