Skip to content

calintzy/dotfig

Repository files navigation

dotfig

One config to rule them all — generate ESLint, Prettier, TypeScript, EditorConfig from a single dotfig.yml

한국어 | 中文 | 日本語

Why?

Every new project needs 5–10 config files: eslint.config.js, .prettierrc, tsconfig.json, .editorconfig, .gitignore... They all share overlapping settings (indent size, quotes, semicolons) but each uses a different format.

dotfig lets you define your preferences once in dotfig.yml and generates all config files automatically.

dotfig.yml  →  eslint.config.js
             →  .prettierrc
             →  tsconfig.json
             →  .editorconfig
             →  .gitignore

Install

npm install -g dotfig

Quick Start

# Interactive setup — creates dotfig.yml
dotfig init

# Generate all config files
dotfig sync

dotfig.yml

version: 1
preset: typescript          # typescript | react | node

rules:                      # Shared across all tools
  indent: 2                 # → prettier, editorconfig, eslint
  semicolons: false         # → prettier, eslint
  quotes: single            # → prettier, eslint
  line-width: 100           # → prettier, editorconfig, eslint

typescript:                 # tsconfig.json options
  strict: true
  target: ES2024
  jsx: react-jsx            # Auto-set by react preset
  paths:
    "@/*": ["./src/*"]

lint:                       # Extra ESLint rules
  no-unused-vars: error
  no-console: warn

format:                     # Extra Prettier options
  trailing-comma: all
  bracket-spacing: true

gitignore:                  # Extra .gitignore patterns
  extra:
    - "*.local"
    - ".env"

How It Works

The rules section is the key idea. Define once, apply everywhere:

dotfig.yml Prettier ESLint EditorConfig
indent: 2 tabWidth: 2 indent rule indent_size = 2
semicolons: false semi: false semi rule
quotes: single singleQuote: true quotes rule
line-width: 100 printWidth: 100 max-len rule max_line_length = 100

Generated Files

Source Output
rules + format .prettierrc
rules + lint eslint.config.js (flat config)
rules + typescript tsconfig.json
rules .editorconfig
preset + gitignore .gitignore

Presets

Presets provide sensible defaults. Your explicit dotfig.yml values always take precedence.

Preset Description
typescript Strict TypeScript + ESM + Prettier defaults
react TypeScript + JSX + React ESLint plugins
node TypeScript + Node.js target

Commands

dotfig init

Interactive wizard that creates dotfig.yml by asking your preferences:

  • Preset selection (typescript / react / node)
  • Indent size, semicolons, quote style, line width

dotfig sync

Reads dotfig.yml and generates all config files in the current directory.

$ dotfig sync
✓ 생성 .editorconfig
✓ 생성 .gitignore
✓ 생성 .prettierrc
✓ 생성 tsconfig.json
✓ 생성 eslint.config.js

✓ 5개 설정 파일이 생성되었습니다.

License

MIT

About

One config to rule them all — generate ESLint, Prettier, TypeScript, EditorConfig from a single dotfig.yml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors