Thanks for your interest. Here's everything you need.
git clone https://github.com/your-username/dotdrift
cd dotdrift
npm install# Run against a real project
npm run dev -- scan --dir path/to/project
# Watch mode during development
npm run dev -- watch --dir src
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Type check
npm run typechecksrc/
cli.ts — CLI entry (citty), command definitions
scanner.ts — AST traversal, process.env extraction
envparser.ts — .env and .env.example reader
differ.ts — Cross-reference scanner output vs env files
reporter.ts — Terminal output (picocolors) and JSON format
watcher.ts — File watching via chokidar
config.ts — Config file loading and merging
index.ts — Public API exports
tests/
scanner.test.ts
differ.test.ts
reporter.test.ts
fixtures/
simple-project/ — Minimal fixture with known issues
edge-cases/ — Destructuring, computed keys, etc.
- Add the rule name to the
RuleIdtype insrc/types.ts - Implement detection in the relevant module (
scanner.tsfor source-side,differ.tsfor comparison-side) - Add it to the default config in
src/config.ts - Document it in the Rules Reference table in
README.md - Add a test fixture and test case
- One PR per feature or fix
- Add or update tests for any changed behavior
- Run
npm run typecheck && npm testbefore submitting - Keep the scope small — large PRs are hard to review
Open an issue with:
- DotDrift version (
npx dotdrift --version) - Node.js version (
node --version) - A minimal reproduction (ideally a fixture or code snippet)
- Expected vs actual output
By contributing, you agree your contributions will be licensed under MIT.