Problem
No linting or formatting tools were configured. Code style was enforced through convention only, making it easy for inconsistencies to slip into PRs.
Solution
Added ESLint and Prettier with project-aligned defaults:
New Files
.eslintrc.json — ESLint config extending @typescript-eslint/recommended with prettier to avoid conflicts
.prettierrc — Prettier config matching codebase conventions (double quotes, semicolons, trailing commas, 120 print width, 2-space indent)
.prettierignore — Excludes dist/, node_modules/, scripts/
Updated Files
package.json — Added devDependencies and scripts
New Dependencies
eslint
@typescript-eslint/eslint-plugin
@typescript-eslint/parser
eslint-config-prettier
prettier
New Scripts
| Script |
Purpose |
npm run lint |
Check for lint errors |
npm run lint:fix |
Auto-fix lint errors |
npm run format |
Format all files with Prettier |
npm run format:check |
Check if files are formatted |
ESLint Rules
@typescript-eslint/no-unused-vars — error (args/vars prefixed with _ allowed)
@typescript-eslint/no-explicit-any — warn
@typescript-eslint/require-await — warn
no-console — off (CLI tool requires console output)
Prettier Config
semi: true
singleQuote: false
trailingComma: "all"
printWidth: 120
tabWidth: 2
Verification
npm run lint — 0 errors, 3 warnings
npm run format:check — all files pass
npm test — all tests pass (2 pre-existing Windows-specific failures unrelated to this change)
Why This Matters
- Enforces consistent formatting without manual review overhead
- Catches common bugs (unused imports, implicit
any, etc.) before review
- Makes contributor onboarding smoother with auto-format on save
- Prevents ESLint/Prettier conflicts via
eslint-config-prettier
Problem
No linting or formatting tools were configured. Code style was enforced through convention only, making it easy for inconsistencies to slip into PRs.
Solution
Added ESLint and Prettier with project-aligned defaults:
New Files
.eslintrc.json— ESLint config extending@typescript-eslint/recommendedwithprettierto avoid conflicts.prettierrc— Prettier config matching codebase conventions (double quotes, semicolons, trailing commas, 120 print width, 2-space indent).prettierignore— Excludesdist/,node_modules/,scripts/Updated Files
package.json— Added devDependencies and scriptsNew Dependencies
eslint@typescript-eslint/eslint-plugin@typescript-eslint/parsereslint-config-prettierprettierNew Scripts
npm run lintnpm run lint:fixnpm run formatnpm run format:checkESLint Rules
@typescript-eslint/no-unused-vars— error (args/vars prefixed with_allowed)@typescript-eslint/no-explicit-any— warn@typescript-eslint/require-await— warnno-console— off (CLI tool requires console output)Prettier Config
semi: truesingleQuote: falsetrailingComma: "all"printWidth: 120tabWidth: 2Verification
npm run lint— 0 errors, 3 warningsnpm run format:check— all files passnpm test— all tests pass (2 pre-existing Windows-specific failures unrelated to this change)Why This Matters
any, etc.) before revieweslint-config-prettier