Configuration
This guide will help you configure DeepLint for your project.
This is part of the Getting Started series:
Configuration (current page)
Initialization
The easiest way to configure DeepLint is to use the initialization command:
deeplint initThis command will:
Create a configuration file in your project root
Set up default configuration options
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.jswith ESM syntaxFor CJS projects:
deeplint.config.jsordeeplint.config.cjswith 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.
This will create a deeplint.config.js or deeplint.config.mjs file with ECMAScript Modules syntax.
This will create a .deeplintrc.yml file.
This will create a .deeplintrc.json file.
Configuration File Locations
DeepLint uses cosmiconfig to find your configuration file. It will look for configuration in the following places (in order of precedence):
package.jsonwith a"deeplint"property.deeplintrcfile (no extension) in JSON or YAML format.deeplintrc.json,.deeplintrc.yaml,.deeplintrc.yml,.deeplintrc.js,.deeplintrc.cjs, or.deeplintrc.mjsfiledeeplint.config.js,deeplint.config.cjs,deeplint.config.mjs, ordeeplint.config.tsfileAny of the above in a
.configsubdirectory
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:
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,--jsonEnv:
OPENAI_API_KEY,OPENAI_MODELPrecedence: CLI > Env > Config file > Defaults
For a full list of options and details, see the LLM Configuration Guide.
Deprecated Options
Configuration Methods
DeepLint uses a cascading configuration system powered by cosmiconfig, where values are resolved in the following order (highest precedence first):
Command-line options (e.g.,
--model,--unstaged)Environment variables (e.g.,
OPENAI_API_KEY,OPENAI_MODEL)Configuration file (searched in the order listed in Configuration File Locations)
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:
Log warnings about invalid configuration options
Apply default values to fix invalid values
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,000contextBuilder.tokensPerFile: Must be a number between 100 and 10,000contextBuilder.maxFileSize: Must be a number between 1 and 10,000contextBuilder.includeDependencies: Must be a booleancontextBuilder.includeStructure: Must be a booleanfiles.includeandfiles.exclude: Must be arrays of stringsgit.includeUnstaged: Must be a boolean
For a complete list of validation rules, see the Configuration System documentation.
Related Resources
Context Building - Learn how context building works
Configuration System - Technical details of the configuration system
Command Line Options - Command line options that override configuration
Developer Note: The configuration system uses a schema-based validation approach with automatic defaults. If a configuration option is invalid, DeepLint will apply a sensible default value and continue running.
Next Steps
Now that you've configured DeepLint, you can:
Run your first analysis - Learn how to analyze your code
Set up Git integration - Integrate with your Git workflow
Previous: Installation | Next: First Run →
Last updated