fixmyfile
v1.1.0
Published
Compiler-driven CLI that automatically fixes common TypeScript errors using AST transformations
Maintainers
Readme
fixmyfile 🚀
⚡ Demo
Fix recurring TypeScript workflow friction automatically.
✨ What it does
fixmyfile detects common TypeScript friction points and applies automatic fixes using compiler diagnostics and AST transformations.
It focuses on repetitive issues that slow developers down during everyday TypeScript development.
⚡ Example
❌ Before
const values = [1, 2, undefined, 4].filter(Boolean);
const doubled = values.map((v) => v * 2);TypeScript may still complain that:
'v' is possibly 'undefined'✅ After
const values = [1, 2, undefined, 4].filter((x): x is NonNullable<typeof x> =>
Boolean(x),
);
const doubled = values.map((v) => v * 2);TS2339 Property Synchronization
Before
type Props = {
title: string;
};
function Card({ title, subtitle }: Props) {
return subtitle;
}After
type Props = {
title: string;
subtitle?: unknown;
};
function Card({ title, subtitle }: Props) {
return subtitle;
}✨ Current Fixes
- Fix missing function arguments (
TS2554) - Fix simple type mismatches (
TS2322) - Handle undefined symbol errors (
TS2304) - Improve
.filter(Boolean)type narrowing automatically - Add optional chaining for possibly undefined access (
TS18048) - Synchronize object type definitions when properties are referenced but missing (
TS2339)
🖥 Usage
fixmyfile <file>📁 Examples
See the examples/ folder for sample files and transformations.
📦 Installation
npm install -g fixmyfile📁 Examples
See the examples/ folder for sample files.
🚧 Scope
fixmyfile currently focuses on:
- common TypeScript workflow friction
- repetitive compiler issues
- safe AST-based transformations
- single-file automatic fixes
- deterministic compiler-driven transformations
The project intentionally prioritizes predictable and reliable transformations over aggressive code mutation.
🤝 Contributing
Contributions, issue reports, and TypeScript pain-point discussions are welcome.
Please open an issue before major changes.
🚧 Future Improvements
- imported type synchronization
- additional TypeScript diagnostics
- cross-file fixes
- improved project-scale analysis
📄 License
MIT
🔗 Repository
https://github.com/i-am-killvish/fixmyfile
