Skip to content
AddHunt

ai-typescript-check

ChatGPT plugin and API for TypeScript type checking

Open source

  • Open source
  • Licence: MIT

In short

ai-typescript-check is an open-source ChatGPT plugin, custom GPT and REST API that lints, type-checks and explains TypeScript, JSX/TSX and JavaScript code. It is for developers who want a language model's answers about code backed by real compiler output.

What you get

  • Linting, error checking and type checking for TS, JSX/TSX and JS
  • Auto-completion and type information
  • Built on a modified @typescript/twoslash
  • Custom GPT version named Typescript Analyzer
  • Standalone REST API with an OpenAPI spec

The details

ai-typescript-check gives ChatGPT access to the TypeScript compiler. When a user pastes a snippet and asks for a check, the plugin runs the code through a modified version of @typescript/twoslash and returns linting results, errors, type information and completions, which the model then explains in plain language. Because it builds on twoslash, the usual twoslash annotations and tricks work without extra setup.

Ways to use it

  • As a ChatGPT plugin, installed from the plugin store or added manually as an unverified plugin by entering the API address
  • Through a custom GPT called Typescript Analyzer
  • As a standalone REST API that any coding environment can call

The API

The API takes a POST request with the code, a file extension and optional settings, sent as JSON or as form data, and answers with JSON. Options can also be passed as a query parameter. An OpenAPI specification is published under the site's well-known path for tools that read it.

The project covers TypeScript, JSX/TSX and plain JavaScript files. It is released on GitHub under the MIT license, and the author invites feedback and suggestions.

Alternatives to ai-typescript-check

Questions

Can it be used outside ChatGPT?

Yes. The same checks are available as a standalone REST API that accepts code, a file extension and options.

Which file types does it handle?

TypeScript, JSX/TSX and JavaScript.

Is there a custom GPT?

Yes. A GPT named Typescript Analyzer offers the analyzer inside ChatGPT.

More like this