Overview
The@zayne-labs/eslint-config package includes a CLI tool for easy setup and migration of ESLint configurations. The CLI automates the process of updating your project files, installing dependencies, and configuring VS Code settings.
Installation
Run the CLI without installation using your package manager:Commands
Default Command
Runs the initialization or migration wizard.Skip prompts and use default values. Useful for CI/CD or automated setups.Alias:
-ySpecify framework templates for optimal customization. Multiple frameworks can be specified.Alias:
-tAvailable templates:vuereactsvelteastrosolid
Specify extra utility integrations.Alias:
-eAvailable extras:tailwindcss- TailwindCSS linting support
Help
Display help information.Version
Display the installed version.Interactive Prompts
When running without the--yes flag, the CLI will guide you through an interactive setup:
1. Uncommitted Changes Check
The CLI checks for uncommitted changes in your Git repository. If found, you’ll be prompted to confirm before proceeding.It’s recommended to commit your changes before running the migration to make it easier to review the changes made by the CLI.
2. Framework Selection
Select the frameworks used in your project:3. Extra Utilities
Select additional utilities to integrate:4. VS Code Settings
Choose whether to update.vscode/settings.json for a better development experience:
- ESLint auto-fix on save
- Disable conflicting formatters
- Enable ESLint for supported file types
What the CLI Does
The CLI performs three main stages:Stage 1: Update package.json
- Adds
@zayne-labs/eslint-configto dependencies - Adds required ESLint plugins based on your selections
- Adds
eslintandtypescriptif not present - Removes legacy ESLint config fields (
eslintConfig) - Adds lint script if not present:
"lint": "eslint ."
Stage 2: Update ESLint Files
- Creates
eslint.config.jswith your selected configuration - Removes old ESLint config files (
.eslintrc.*,.eslintignore) - Generates TypeScript-aware configuration if TypeScript is detected
eslint.config.js
Stage 3: Update VS Code Settings
If enabled, updates or creates.vscode/settings.json with:
Examples
Interactive Setup
Run without options for full interactive experience:React Project with TypeScript
Vue Project (Skip Prompts)
Multi-Framework Project
CI/CD Setup
For automated setups in CI/CD pipelines:Post-Installation
After running the CLI:-
Install dependencies:
-
Run ESLint fix:
-
Review changes:
- Check the generated
eslint.config.js - Review updates to
package.json - Verify
.vscode/settings.jsonif updated
- Check the generated
-
Customize configuration:
- Edit
eslint.config.jsto add project-specific rules - Add custom ignore patterns
- Configure framework-specific options
- Edit
Troubleshooting
”eslint.config.js already exists”
The CLI will not overwrite an existingeslint.config.js. Either:
- Rename or remove the existing file
- Manually migrate using the customization guide
Missing Dependencies
If you see errors about missing plugins after setup:Type Errors in Config
If using TypeScript and seeing type errors ineslint.config.js:
- Rename to
eslint.config.mjsfor native ESM - Or add JSDoc types:
Environment Variables
Set to
true to skip all prompts (same as --yes).