Init Command
This guide explains how to use the DeepLint init command to set up DeepLint in your project.
Overview
The init command initializes DeepLint in your project by creating a configuration file. This is typically the first command you'll run when setting up DeepLint for a new project.
The init command:
Creates a configuration file in your project root
Sets up default configuration options
Prompts you for any required information
Basic Usage
To initialize DeepLint in your project, run:
deeplint initThis will create a configuration file with default settings in your project root.
Command Options
The init command supports the following options:
OPTIONS
--force, -f Overwrite existing config [default: false]
--js Create JavaScript config [default: true]
--yaml Create YAML config [default: false]
--help, -h Display help for this command--force, -f
The --force option allows you to overwrite an existing configuration file:
deeplint init --forceThis is useful when you want to reset your configuration to the default values.
--js
The --js option explicitly specifies that you want to create a JavaScript configuration file:
deeplint init --jsThis is the default behavior, so you don't need to specify this option unless you want to be explicit.
--yaml
The --yaml option specifies that you want to create a YAML configuration file:
deeplint init --yamlThis will create a .deeplintrc.yml file instead of a JavaScript configuration file.
Command Aliases
The init command has the following aliases:
Full-Word Aliases:
initialize: Initialize DeepLint in the current projectcreate-config: Create a DeepLint configuration file
Short Aliases:
i: Initialize DeepLint in the current project
You can use any of these aliases instead of init:
deeplint initialize
deeplint create-config
deeplint iExamples
Here are some examples of using the init command:
deeplint initCreates a JavaScript configuration file (deeplint.config.js) with default settings.
deeplint init --forceOverwrites an existing configuration file with default settings.
deeplint init --yamlCreates a YAML configuration file (.deeplintrc.yml) with default settings.
deeplint i
deeplint initialize
deeplint create-configAll of these commands do the same thing as deeplint init.
Configuration File
The init command creates a configuration file with default settings. Here's an example of the default configuration:
import { defineConfig } from "deeplint";
export default defineConfig({
contextBuilder: {
contextType: "light",
maxTokens: 8000,
tokensPerFile: 1000,
maxFileSize: 500,
includeDependencies: false,
maxDependencyDepth: 1,
includeStructure: true,
},
files: {
include: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
exclude: ["node_modules/**", "dist/**", "build/**"],
useGitignore: true,
},
git: {
includeUnstaged: false,
},
logging: {
level: "info",
},
});contextBuilder:
contextType: light
maxTokens: 8000
tokensPerFile: 1000
maxFileSize: 500
includeDependencies: false
maxDependencyDepth: 1
includeStructure: true
files:
include:
- "**/*.js"
- "**/*.ts"
- "**/*.jsx"
- "**/*.tsx"
exclude:
- "node_modules/**"
- "dist/**"
- "build/**"
useGitignore: true
git:
includeUnstaged: false
logging:
level: infoTroubleshooting
Configuration File Already Exists
If a configuration file already exists, the init command will fail with an error:
ERROR: Configuration file already exists at /path/to/your/project/deeplint.config.jsTo overwrite the existing configuration file, use the --force option:
deeplint init --forcePermission Issues
If you don't have permission to write to the project directory, the init command will fail with an error:
ERROR: Permission denied: Could not write to /path/to/your/project/deeplint.config.jsMake sure you have write permission for the project directory.
Next Steps
After initializing DeepLint, you can:
Configure DeepLint for your project
For more information about DeepLint's configuration options, see the Configuration guide.
Last updated