CLI Tool
Quick setup with JS Style Kit’s command-line interface
Overview
JS Style Kit includes a CLI tool to help quickly set up your project with ESLint and Prettier configurations. This tool is currently in beta and works best with new projects.
Basic Usage
Run the initialization command:
This will:
- Install JS Style Kit as a dev dependency
- Create configuration files
- Set up package.json scripts
- Configure VS Code settings
What the CLI Does
1. Detects Package Manager
The CLI automatically detects which package manager you’re using based on lock files:
bun.lock
→ Bunpnpm-lock.yaml
→ pnpmyarn.lock
→ Yarn- Otherwise → npm
2. Installs Dependencies
The CLI will:
- Install JS Style Kit as a dev dependency
- Remove overlapping dependencies (ESLint, Prettier) to avoid conflicts
3. Creates Configuration Files
The CLI creates the following files:
style-kit.config.js
orstyle-kit.config.mjs
(based on your project’s module type)eslint.config.js
oreslint.config.mjs
prettier.config.js
orprettier.config.mjs
4. Updates package.json Scripts
The CLI adds these scripts to your package.json:
5. Configures VS Code
The CLI updates or creates .vscode/settings.json
with:
File Structure
After running the CLI, your project will have this configuration structure:
The style-kit.config.js
file will contain:
Limitations
The CLI tool is still in beta, with some limitations:
- Works best with fresh projects
- May not handle complex project setups properly
- Limited customization during installation
Manual Configuration
If you prefer more control or the CLI doesn’t work for your project, you can always set up JS Style Kit manually.