Get Diagnostics
getDiagnosticsRetrieve all diagnostics for a TypeScript/JavaScript file in a tsconfig project, including errors, warnings, and suggestions for type errors, unused code, and imports.
Instructions
Get all errors, warnings, and suggestions for a TypeScript/JavaScript file. Reports type errors, unused variables, unused imports, unreachable code, and more. Requires the file to be part of a tsconfig.json project. Unused-code diagnostics only appear if tsconfig has noUnusedLocals/noUnusedParameters enabled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) |