1.6 KiB
1.6 KiB
Implementation Plan for tsbuild check
Command
Overview
Add a new check
command to tsbuild that allows checking TypeScript files against a glob pattern without emitting them, similar to running the TypeScript compiler with the --noEmit
flag.
Implementation Steps
-
Reread CLAUDE.md to ensure we follow project guidelines
-
Extend TsBuild Class
- The existing
TsBuild
class already has acheckEmit()
method - We can leverage this method for our implementation
- The existing
-
Implement Check Command in CLI
- Add a new
check
command totsbuild.cli.ts
- Command should accept glob patterns as arguments
- Process glob patterns to find matching TypeScript files
- Use the
TsBuild
class to check the files without emitting
- Add a new
-
Update Exports
- Ensure any new functionality is properly exported
-
Testing
- Test the command with various glob patterns
- Verify error reporting works correctly
Differences from Existing emitcheck
Command
The emitcheck
command already exists and checks specific files without emitting. Our new check
command will:
- Be designed specifically for checking files against glob patterns
- Use a simpler, more intuitive command name
- Potentially add additional benefits (like summary statistics of checked files)
Example Usage
Once implemented, the command would work like this:
npx tsbuild check ts/**/*
npx tsbuild check "src/**/*.ts" "test/**/*.ts"
Expected Output
The command should:
- Report any TypeScript errors in the matched files
- Provide a count of files checked and any errors found
- Exit with code 0 if successful, or 1 if errors are found