This guide will help you install DeepLint and set it up in your project.
Before installing DeepLint, ensure you have the following prerequisites:
Node.js: Version 22.0.0 or higher
Package Manager: npm, yarn, or pnpm (pnpm is recommended)
Git: For Git hook integration
Installing DeepLint globally allows you to use it across multiple projects:
After installation, verify that DeepLint is installed correctly:
You can also install DeepLint as a development dependency in your project:
When installed locally, you can run DeepLint using npx:
DeepLint requires an API key for the LLM provider you want to use. Currently, the following providers are supported:
OpenAI (GPT-4)
Anthropic (Claude)
Google (Gemini)
You can set up your API key in several ways:
Add your API key to your environment variables:
For persistent configuration, add this to your shell profile (.bashrc, .zshrc, etc.).
You can also add your API key to the DeepLint configuration file. We'll cover this in the section.
Never commit your API keys to version control. If you add them to your configuration file, make sure to add the file to your .gitignore.
If you encounter issues during installation, check the following:
Ensure you have the correct Node.js version (22.0.0+)
Check your network connection
Verify you have the necessary permissions to install global packages
If using pnpm, ensure it's properly configured
For more detailed troubleshooting, run the installation with verbose logging:
DeepLint supports both CommonJS (CJS) and ECMAScript Modules (ESM) environments:
The package automatically detects your project's module format
For ESM projects, use import syntax:
For CJS projects, use require syntax:
All dependencies are bundled for maximum compatibility, including ESM-only dependencies like chalk
This dual-format support means you can use DeepLint in any JavaScript or TypeScript project, regardless of the module system it uses.
Now that you have DeepLint installed, you can:
- Set up your project configuration
- Learn how to analyze your code
- Integrate with your Git workflow
- Learn about available commands
- Customize DeepLint for your project
- Understand how DeepLint analyzes your code
Developer Note: If you're developing DeepLint itself, you can clone the repository and use the development scripts. See the guide for more information.
If you want to contribute to DeepLint or run it from source, follow these steps:
Clone the Repository
Install Dependencies
Set Up Environment Variables
Copy the sample environment file and modify as needed:
Edit the .env file to include your OpenAI API key:
For more detailed information about the development workflow, see the guide.
Next:
Build the Project
Run the Development Server
# Build the project with tsup (generates both ESM and CJS outputs)
pnpm buildpnpm dev# Using npm
npm install -g deeplint-cli
# Using yarn
yarn global add deeplint-cli
# Using pnpm (recommended)
pnpm add -g deeplint-clideeplint --version# Using npm
npm install --save-dev deeplint-cli
# Using yarn
yarn add --dev deeplint-cli
# Using pnpm (recommended)
pnpm add -D deeplint-clinpx deeplint# For OpenAI
export OPENAI_API_KEY=your-api-key
# For Anthropic
export ANTHROPIC_API_KEY=your-api-key
# For Google
export GOOGLE_API_KEY=your-api-keypnpm add -g deeplint-cli --verboseimport { defineConfig } from "deeplint-cli";const { defineConfig } = require("deeplint-cli");git clone https://github.com/your-org/deeplint-cli.git
cd deeplint-clipnpm installcp .env.sample .envOPENAI_API_KEY=your_api_key_here