Implement Stricter Typescript configuration Project (GSoC 2025)

Summary

Project Description

This project aims to enforce stricter TypeScript configurations across OpenMRS repositories, ensuring developers follow best practices for strong typing. The primary goal is to eliminate the use of any, enforce strict type safety, and refactor existing code to comply with these rules.

By implementing stricter TypeScript settings and refining type definitions, this project will enhance code maintainability, reduce runtime errors, and improve the overall developer experience.

Project Size

Medium

Primary mentor

@Christopher Lumu

Backup mentor

TBA

Selected Contributor

TBA
(It is still the application period. If you're reading this, you might be the one filling this spot soon.)

✅ Current Implementation

Several OpenMRS frontend repositories use TypeScript, but the current configuration is relatively lenient. Some repositories allow any and do not fully enforce strict type checks. The existing tsconfig.json files vary across projects, leading to inconsistencies in typing practices.

Key challenges in the current implementation:

  • Usage of any in multiple places due to missing or incomplete type definitions.

  • Inconsistent TypeScript configurations across different repositories.

  • Limited enforcement of strong typing in CI/CD and linting rules.

To implement stricter TypeScript configurations, the following steps will be involved

  • Refactor Existing Codebases: Modify current TypeScript code to comply with the stricter settings. This may involve adding explicit types, handling potential null or undefined values, and resolving any type errors that arise

  • Enhance ESLint Rules: Strengthen ESLint configurations to enforce coding standards and catch potential issues early. This includes integrating TypeScript-specific linting rules.Run TypeScript and ESLint checks on pull requests, ensuring that new code adheres to the enforced standards.

🛠️ What You'll Need

To successfully work on this project, contributors should have:
Strong knowledge of TypeScript (including generics, type inference, and strict mode).
Experience with React and OpenMRS Microfrontends (or willingness to learn).
Familiarity with ESLint and TypeScript linting rules.
Understanding of API response typing and best practices for defining types
Experience with CI/CD pipelines (GitHub Actions, pre-commit hooks)
Enthusiasm for learning!

Expected Outcomes

🔹 A more maintainable and robust TypeScript codebase.
🔹 Consistent TypeScript configurations across OpenMRS repositories.
🔹 A well-documented guide to help developers adopt strict typing practices.
🔹 Improved developer experience and reduced runtime errors.

What You'll Gain

This project offers an exceptional opportunity to:

  • 🎯 Gain Expertise in TypeScript Best Practices

    • Work with real-world large-scale TypeScript applications.

    • Learn how to enforce strong typing and prevent common TypeScript pitfalls.

    🎯 Improve Problem-Solving & Debugging Skills

    • Work with an existing codebase and improve its maintainability.

    • Debug and refactor legacy TypeScript code to comply with stricter rules.

    🎯 Join an Active Open Source Community:

    • OpenMRS has a vibrant, supportive community of developers and healthcare professionals. You'll get to collaborate with experienced mentors and contribute to meaningful discussions about healthcare software development.

    🎯 Gain Hands-on Experience with CI/CD & Automation

    • Learn how pre-commit hooks and ESLint rules enforce best practices.

    🎯 Improve Collaboration & Documentation Skills

    • Document changes and create developer-friendly guides for future contributors.

    • Engage with an active community to discuss and implement best practices.

Related content