Skip to content

Code Linter

Code Linter reviews a piece of code and says whether it is well written or has syntax errors, such as an unclosed bracket. It is useful when a model generates code and you want to check it before using it.

When to use it

  • Checking the code an agent writes before saving or running it.
  • Asking an agent to fix its own code until it has no errors.

Configuration

FieldWhat it does
Source CodeThe code to review.
Programming LanguageThe code’s language: python (default), javascript, typescript, php, csharp, go, java, c, cpp, swift or kotlin.

Output

The Lint Result output says whether the code is valid and, if not, where the errors are.

In tool mode, an agent can use the component by itself. See Tool Mode.

Example

A team uses an agent that writes small JavaScript scripts.

  1. Connect Code Linter in tool mode to the agent, with javascript in Programming Language.
  2. In the agent’s instructions, ask it to check its code with the tool before handing it over.

Good practices

  • It only checks syntax: code with no writing errors may still not do what you want.