Ts Screener Portable (90% Real)
private checkStrictOptions(sourceFile: ts.SourceFile): string[] const errors: string[] = []; if (this.options.noImplicitAny) // Check compiler flags via parsing tsconfig.json if needed // Simplified: we already flagged implicitAnyLines
program .name('ts-screener') .description('Analyze TypeScript type coverage and any usage') .option('-i, --include <patterns>', 'glob patterns to include', ' /*.ts,tsx') .option('-e, --exclude <patterns>', 'glob patterns to exclude', 'node_modules/ ') .option('--target-coverage <number>', 'minimum type coverage %', '80') .option('--json', 'output as JSON') .option('--no-implicit-any', 'fail on implicit any') .action(async (options) => const screener = new TypeScriptScreener( include: options.include.split(','), exclude: options.exclude.split(','), targetTypeCoverage: parseFloat(options.targetCoverage), noImplicitAny: options.noImplicitAny, );
);
# Install npm install -g ts-screener Run in project ts-screener --include "src/**/*.ts" --target-coverage 90 JSON output ts-screener --json > report.json Fail on implicit any ts-screener --no-implicit-any ✅ Example Output 📊 TypeScript Screener Report ✅ Files scanned: 124 🎯 Type coverage: 94.2% ⚠️ Total 'any' usage: 3 ❓ Missing type annotations: 12 🏁 Status: PASSED ✅
📄 src/api/client.ts Missing types: Missing type: data, Missing type: config 'any' usage count: 2 This gives you a production-ready, extensible TypeScript quality gate. Want me to add a or IDE plugin next? ts screener
🔍 Problematic files:
program.parse(); import ScreenerReport from '../types.js'; export function consoleReporter(report: ScreenerReport): void console.log('\n📊 TypeScript Screener Report\n'); console.log( ✅ Files scanned: $report.summary.filesScanned ); console.log( 🎯 Type coverage: $report.summary.typeCoveragePercent% ); console.log( ⚠️ Total 'any' usage: $report.summary.totalAnyUsage ); console.log( ❓ Missing type annotations: $report.summary.totalMissingTypes ); console.log( 🏁 Status: $report.summary.passed ? 'PASSED ✅' : 'FAILED ❌' ); private checkStrictOptions(sourceFile: ts
const program = new Command();