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-7/

TypeScript Project Analyzer

Build a utility that analyzes TypeScript configuration and type errors in a Create React App project.

Overview

Create a tool that checks if a Create React App project is properly configured for TypeScript and runs type checking to detect any errors. The tool should leverage Create React App's TypeScript integration features.

Requirements

Create a Node.js module that analyzes TypeScript configuration in Create React App projects:

  1. Validates TypeScript Configuration

    • Checks if tsconfig.json exists in the project
    • Verifies TypeScript is installed as a dependency
  2. Performs Type Checking

    • Runs TypeScript compiler to check for type errors
    • Collects type errors with file paths and messages
  3. Returns Analysis Results

    • Returns an object with success status and error details
    • Includes the number of TypeScript files checked
    • Provides error information for debugging

Test Cases

  • When run on a Create React App project with no TypeScript files, it reports that TypeScript is not configured @test
  • When run on a Create React App project with TypeScript files and no errors, it reports success with the count of files checked @test
  • When run on a Create React App project with TypeScript files containing type errors, it reports the errors with file names and error descriptions @test

Implementation

@generates

API

/**
 * Validates TypeScript configuration and runs type checking
 * @param {string} projectPath - Path to the Create React App project directory
 * @returns {Promise<{success: boolean, filesChecked: number, errors: Array<{file: string, message: string}>}>}
 */
async function validateTypeScript(projectPath) {
  // Implementation here
}

module.exports = { validateTypeScript };

Dependencies { .dependencies }

create-react-app { .dependency }

Provides TypeScript integration with parallel type checking support, automatic tsconfig.json generation, and ForkTsCheckerWebpackPlugin for non-blocking type checks.

@satisfied-by

Install with Tessl CLI

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

tile.json