circle-exclamation
Deeplint is still in the MVP development phase and not yet available for use.

Configuration

This guide will help you configure DeepLint for your project.

circle-info

This is part of the Getting Started series:

  1. Configuration (current page)

Initialization

The easiest way to configure DeepLint is to use the initialization command:

deeplint init

This command will:

  1. Create a configuration file in your project root

  2. Set up default configuration options

  3. Detect whether your project is using ESM or CJS and create the appropriate file format

By default, the init command will detect your project's module format and create the appropriate configuration file:

  • For ESM projects (with "type": "module" in package.json): deeplint.config.js with ESM syntax

  • For CJS projects: deeplint.config.js or deeplint.config.cjs with CJS syntax

You can also specify the format you want to use:

This will create a deeplint.config.js or deeplint.config.cjs file with CommonJS syntax.

Configuration File Locations

DeepLint uses cosmiconfig to find your configuration file. It will look for configuration in the following places (in order of precedence):

  1. package.json with a "deeplint" property

  2. .deeplintrc file (no extension) in JSON or YAML format

  3. .deeplintrc.json, .deeplintrc.yaml, .deeplintrc.yml, .deeplintrc.js, .deeplintrc.cjs, or .deeplintrc.mjs file

  4. deeplint.config.js, deeplint.config.cjs, deeplint.config.mjs, or deeplint.config.ts file

  5. Any of the above in a .config subdirectory

This flexible configuration system allows you to use the format and location that best fits your project structure.

Configuration File

The configuration file contains settings for DeepLint's behavior. Here are examples for both ESM and CJS:

Configuration Options

The following table shows all available configuration options and their implementation status:

Section
Status
Description

contextBuilder

✅ Implemented

Controls how DeepLint builds context for analysis

files

✅ Implemented

Controls which files are included in the analysis

git.includeUnstaged

✅ Implemented

Controls whether to include unstaged changes

logging

✅ Implemented

Controls logging behavior

llm

✅ Implemented

Controls LLM-powered analysis

ignore

⚠️ Deprecated

Use files.exclude instead

Note: For planned features such as custom rules, auto-fixes, and advanced hooks, see the Roadmap.

Context Builder

Configure how DeepLint builds context for analysis:

For more details on context building, see Context Building.

File Filtering

Control which files are included in the analysis:

Git Integration

Configure Git integration:

For more details on Git integration, see Git Integration.

Logging

Configure logging behavior:

LLM Configuration

Configure LLM-powered analysis (AI linting):

LLM options can also be set via CLI flags or environment variables:

  • CLI: --provider, --model, --api-key, --instructions, --unstaged, --json

  • Env: OPENAI_API_KEY, OPENAI_MODEL

  • Precedence: CLI > Env > Config file > Defaults

For a full list of options and details, see the LLM Configuration Guidearrow-up-right.

Deprecated Options

Configuration Methods

DeepLint uses a cascading configuration system powered by cosmiconfig, where values are resolved in the following order (highest precedence first):

  1. Command-line options (e.g., --model, --unstaged)

  2. Environment variables (e.g., OPENAI_API_KEY, OPENAI_MODEL)

  3. Configuration file (searched in the order listed in Configuration File Locations)

  4. Default values

This means that:

  • Command-line options override everything else

  • Environment variables override configuration file settings and defaults

  • Configuration file settings override defaults

  • Defaults are used when no other value is provided

Debugging Configuration

To verify the configuration values being used by DeepLint, you can use the --debug flag:

This will print the current configuration values to the console, along with other debug information:

This is particularly useful during development to ensure your configuration is being correctly loaded and applied.

Common Configuration Scenarios

Analyzing Only Specific Files

To analyze only specific files or directories:

Including Unstaged Changes

To include unstaged changes in your analysis:

Using More Comprehensive Analysis

For more comprehensive analysis (at the cost of performance):

Configuration Validation

DeepLint validates your configuration when it loads it. If there are any issues with your configuration, DeepLint will:

  1. Log warnings about invalid configuration options

  2. Apply default values to fix invalid values

  3. Continue with the corrected configuration

For example, if you specify an invalid value for contextBuilder.maxTokens:

DeepLint will log a warning and use the default value:

Validation Rules

Here are some key validation rules:

  • contextBuilder.maxTokens: Must be a number between 1,000 and 100,000

  • contextBuilder.tokensPerFile: Must be a number between 100 and 10,000

  • contextBuilder.maxFileSize: Must be a number between 1 and 10,000

  • contextBuilder.includeDependencies: Must be a boolean

  • contextBuilder.includeStructure: Must be a boolean

  • files.include and files.exclude: Must be arrays of strings

  • git.includeUnstaged: Must be a boolean

For a complete list of validation rules, see the Configuration Systemarrow-up-right documentation.

circle-check

Next Steps

Now that you've configured DeepLint, you can:

  1. Run your first analysis - Learn how to analyze your code

  2. Set up Git integration - Integrate with your Git workflow


Previous: Installation | Next: First Run →

Last updated