{"id":26528,"library":"tsc-output-format","title":"tsc-output-format","description":"tsc-output-format v1.1.1 is a TypeScript library and CLI tool that formats tsc diagnostic output into JSON, GitHub Actions annotations, grouped text, and more. Released in March 2025 with monthly updates, it supports pretty mode, watch mode, and custom formatters/parsers. Unlike other tsc output processors, it provides a pluggable architecture and first-class TypeScript types. Minimal bundle size (<5KB) and zero runtime dependencies make it suitable for CI pipelines.","status":"active","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/codeismyid/tsc-output-format","tags":["javascript","tsc","tsc-output","tsc-output-parser","tsc-output-format","typescript"],"install":[{"cmd":"npm install tsc-output-format","lang":"bash","label":"npm"},{"cmd":"yarn add tsc-output-format","lang":"bash","label":"yarn"},{"cmd":"pnpm add tsc-output-format","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default. ESM-only package.","wrong":"import parse from 'tsc-output-format'","symbol":"parse","correct":"import { parse } from 'tsc-output-format'"},{"note":"Named export. CJS is not supported; use ESM imports.","wrong":"const { format } = require('tsc-output-format')","symbol":"format","correct":"import { format } from 'tsc-output-format'"},{"note":"formatGHA is exported from 'tsc-output-format/formatters' subpath, not main entry point.","wrong":"import { formatGHA } from 'tsc-output-format'","symbol":"formatGHA","correct":"import { formatGHA } from 'tsc-output-format/formatters'"}],"quickstart":{"code":"import { parse, format } from 'tsc-output-format';\nimport { execSync } from 'child_process';\n\nconst tscOutput = execSync('npx tsc --noEmit 2>&1', { encoding: 'utf-8' });\nconst diagnostics = parse(tscOutput);\nconst formatted = format(diagnostics, {\n  formatter: 'json', // or 'gha', 'grouped'\n});\nconsole.log(formatted);\n// Output JSON array of diagnostics with file, line, column, errorCode, message.","lang":"typescript","description":"Parses tsc diagnostic output from a TypeScript compilation and formats it as JSON."},"warnings":[{"fix":"Use import syntax or set { \"type\": \"module\" } in package.json.","message":"Package is ESM-only. Using require() or CommonJS will throw a runtime error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Import from 'tsc-output-format/formatters'.","message":"formatGHA is exported from a subpath, not the main entry.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to v1.1.1 or cast line to number.","message":"In v1.0.0, parse() did not return a 'line' property as number; it was a string. v1.1.0+ may have fixed this, but verify types.","severity":"breaking","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure tsc output is not empty and is a string. Use parse(String(tscOutput)).","cause":"Passing empty or malformed input to parse().","error":"TypeError: Cannot read properties of undefined (reading 'length')"},{"fix":"import { formatGHA } from 'tsc-output-format/formatters';","cause":"Importing formatGHA from the main entry (tsc-output-format) instead of subpath.","error":"SyntaxError: Named export 'formatGHA' not found. The requested module 'tsc-output-format' is a commonjs module..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}