SBCOSS-399: ESLint configuration across all files#51
SBCOSS-399: ESLint configuration across all files#51HarishGangula merged 6 commits intoproject-sunbird:release-8.0.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces ESLint configuration and a corresponding GitHub workflow to enforce code quality checks, while also standardizing coding style across multiple access path controller files.
- Standardizes arrow function syntax and return statement formatting across controllers.
- Adds ESLint configuration and a dedicated GitHub workflow for running lint checks.
Reviewed Changes
Copilot reviewed 59 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/accessPaths/subject.js | Reformatted arrow functions for consistency. |
| controllers/accessPaths/state.js | Updated arrow function parameters and consistent return patterns. |
| controllers/accessPaths/slug.js | Simplified callback formatting with explicit parentheses. |
| controllers/accessPaths/rootOrg.js | Adjusted return statement formatting and arrow function style. |
| controllers/accessPaths/role.js | Standardized arrow function callbacks and formatting. |
| controllers/accessPaths/organisation.js | Enhanced consistency in arrow function usage and formatting. |
| controllers/accessPaths/medium.js | Uniform arrow function formatting applied. |
| controllers/accessPaths/isSuperAdmin.js | Fixed semicolon omission and updated arrow functions. |
| controllers/accessPaths/isMinor.js | Streamlined return statement for clarity. |
| controllers/accessPaths/index.js | Improved arrow functions and variable declarations with refactored function definitions. |
| controllers/accessPaths/gradeLevel.js | Adjusted arrow function formatting for a standardized approach. |
| controllers/accessPaths/framework.js | Ensured consistency in arrow function syntax and formatting. |
| controllers/accessPaths/district.js | Updated arrow function style with clear return statements. |
| controllers/accessPaths/channel.js | Reformatted arrow functions to align with updated style guidelines. |
| controllers/accessPaths/board.js | Applied consistent arrow function formatting and simplified conditionals. |
| controllers/accessPaths/block.js | Standardized arrow function structure and return statements. |
| app.js | Changed variable declaration to const and ensured proper route mounting order. |
| .github/workflows/pull_request.yml | Introduced a GitHub Action workflow for code quality checks. |
| .eslintrc.js | Added ESLint configuration with rules enforcing single quotes, semicolons, and consistent indenting. |
Files not reviewed (1)
- .eslintignore: Language not supported
There was a problem hiding this comment.
Pull Request Overview
This PR implements ESLint configuration and workflow improvements for ensuring code quality in the report-service. The key changes include refactoring various access path functions for consistent arrow function formatting and simplifying control flow by eliminating redundant code blocks.
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/accessPaths/userType.js | Refactored arrow functions and simplified return. |
| controllers/accessPaths/userSubType.js | Similar arrow function refactoring applied. |
| controllers/accessPaths/userId.js | Consistent arrow function formatting improvements. |
| controllers/accessPaths/subject.js | Simplified return and arrow function adjustments. |
| controllers/accessPaths/state.js | Reformatted arrow functions and streamlined returns. |
| controllers/accessPaths/slug.js | Simplified code block with arrow function return. |
| controllers/accessPaths/rootOrg.js | Consistent arrow function formatting. |
| controllers/accessPaths/role.js | Updated arrow function format and direct returns. |
| controllers/accessPaths/organisation.js | Applied consistent arrow function formatting. |
| controllers/accessPaths/medium.js | Simplified arrow functions and direct returns. |
| controllers/accessPaths/isSuperAdmin.js | Standardized arrow function formatting and indentation. |
| controllers/accessPaths/isMinor.js | Direct return used instead of a nested block. |
| controllers/accessPaths/index.js | Updated arrow functions and block formatting. |
| controllers/accessPaths/gradeLevel.js | Simplified arrow functions and control flow. |
| controllers/accessPaths/framework.js | Consistent arrow function formatting applied. |
| controllers/accessPaths/district.js | Streamlined arrow functions and direct returns. |
| controllers/accessPaths/channel.js | Standardized arrow function style for returns. |
| controllers/accessPaths/board.js | Reformatted arrow functions for clarity. |
| controllers/accessPaths/block.js | Updated arrow function format and return style. |
| app.js | Replaced var with const and updated route mounting. |
| controllers/accessPaths/gradeLevel.js | (Repeated changes as similar to others.) |
Comments suppressed due to low confidence (4)
controllers/accessPaths/subject.js:16
- [nitpick] Avoid reassigning the parameter 'subject'. Consider assigning the result to a new variable (e.g., 'const lowerSubject = _.toLower(subject);') for improved clarity.
subject = _.toLower(subject);
controllers/accessPaths/medium.js:16
- [nitpick] Avoid reassigning the parameter 'medium'. It is advisable to use a new variable (e.g., 'const lowerMedium = _.toLower(medium);') to maintain immutability.
medium = _.toLower(medium);
controllers/accessPaths/board.js:16
- [nitpick] Reassigning the 'board' parameter can lead to confusion. Consider declaring a new variable (e.g., 'const lowerBoard = _.toLower(board);') instead of modifying the parameter directly.
board = _.toLower(board);
controllers/accessPaths/role.js:17
- [nitpick] Avoid modifying the function parameter 'role' directly. Using a new variable (e.g., 'const lowerRole = _.toLower(role);') can enhance code clarity and maintainability.
role = _.toLower(role);
There was a problem hiding this comment.
Pull Request Overview
This PR applies ESLint configuration changes across the report-service by adding explicit semicolons where required to adhere to the new linting rules.
- Consistently updated closing braces across multiple controllers by appending semicolons.
- Minor formatting fixes in app.js to ensure code consistency.
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| controllers/accessPaths/*.js | Appended semicolons at end-of-blocks for lint compliance. |
| app.js | Added missing semicolon after require statement and fixed IIFE formatting. |
Uh oh!
There was an error while loading. Please reload this page.