gptlint  by gptlint

LLM-powered linter for enforcing code best practices

created 1 year ago
274 stars

Top 95.2% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

GPTLint is a code quality tool that leverages Large Language Models (LLMs) to enforce higher-level best practices beyond the capabilities of traditional AST-based linters like ESLint. It targets developers seeking to improve code quality by integrating LLM-driven analysis into their existing workflows, offering a novel approach to static analysis.

How It Works

GPTLint augments existing linters by using LLMs to analyze code for complex best practices that are difficult to capture with static analysis alone. Rules are defined in a simple markdown format, allowing for customization and the creation of project-specific rules. The tool supports various LLM providers and local models, features content-based caching for efficiency, and provides detailed LLM usage statistics per run.

Quick Start & Requirements

  • Install via npm: npm install -g gptlint
  • Requires an OpenAI API key by default. Supports other LLM providers and local models.
  • See docs for detailed setup.

Highlighted Details

  • Enforces higher-level best practices impossible with AST-based approaches.
  • Simple markdown format for rules with customization and override capabilities.
  • Supports major LLM providers and local models.
  • Augments ESLint, maintaining compatibility with existing workflows.

Maintenance & Community

  • Follow @transitive_bs on Twitter for updates.

Licensing & Compatibility

  • MIT License. Permissive for commercial use and closed-source linking.

Limitations & Caveats

MVP rules are currently limited to JavaScript/TypeScript and single-file context. Autofixing is not yet supported.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
16 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.