Repository navigation
Abhishek - fix lint rules and write yaml job - #1754
Merged
Merged
Conversation
one-community
approved these changes
Nov 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements mandatory linting and unit testing requirements for all backend pull requests to enforce code quality standards and eliminate manual tracking spreadsheets. The implementation includes automated GitHub Actions workflows, ESLint configuration with enterprise-level rules, Jest coverage enforcement at 60% threshold, and branch protection requirements that prevent merging without passing all checks.
Related PRS (if any):
This backend PR works in conjunction with the frontend PR(#4114) implementing similar linting and testing requirements for the React application.
Main changes explained:
updated .github/workflows/nodejs.yml for automated lint and test checks on every PR
Created jest.config.js with %age coverage thresholds for lines, functions, branches, and statements
Updated ESLint configuration with light enterprise rules (warnings-first approach for gradual adoption)
Added package.json scripts for coverage enforcement (test:ci, test:coverage, lint:check)
Configured Jest to collect coverage from all source files in src/, controllers/, routes/, services/, etc.
Set up coverage exclusions for test files, config files, migrations, and seeders
Implemented GitHub Actions workflow that fails PRs if linting errors exist or coverage falls below 60%
How to test:
Check out current branch
Run npm install to install dependencies
Run npm run lint to verify ESLint configuration works without errors
Run npm run test:ci to check current test coverage levels and verify 60% enforcement
Create a test branch with intentional linting errors (missing semicolon, console.log)
Push and create PR - verify GitHub Actions fails the lint check
Fix linting errors and push again - verify GitHub Actions passes
Verify that PRs cannot be merged without passing both lint and coverage checks
Check that coverage report shows realistic percentages for controllers, routes, and services
Screenshots or videos of changes:
Note:
This PR establishes automated quality gates that completely eliminate manual tracking. The 60% coverage threshold will initially cause test failures for files lacking sufficient tests - teams should add unit tests gradually to meet requirements. No backend code can be merged without passing both ESLint checks and coverage thresholds. The ESLint configuration uses a warnings-first approach to ease developer adoption while maintaining enterprise standards. Also my suggestion is to increase %age coverage from now on gradually in all the modules so that we can follow 60% minimum testing criteria.