[jsweep] Clean check_stop_time.cjs#12764
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
Conversation
- Added JSDoc type annotations for all functions (isValidDate, main) - Extracted date validation logic to isValidDate helper function - Used destructuring for environment variables (GH_AW_STOP_TIME, GH_AW_WORKFLOW_NAME) - Removed comma operator abuse from test file - Improved test file readability with proper statement separation All validation checks passed: - Formatting: npm run format:cjs ✓ - Linting: npm run lint:cjs ✓ - Type checking: npm run typecheck ✓ - Tests: npm run test:js ✓ Test coverage: All existing 5 test cases passing Context: github-script Lines: 42 → 50 (helper function extraction improves maintainability)
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.
Summary
Cleaned and improved
check_stop_time.cjsby adding comprehensive JSDoc type annotations, extracting validation logic, and modernizing the code with ES6+ features. Also significantly improved the test file readability by removing comma operator abuse.Changes
Main File (
check_stop_time.cjs)isValidDate,main)isValidDatehelper function for better code organizationGH_AW_STOP_TIME,GH_AW_WORKFLOW_NAME)!isNaN(stopTimeDate.getTime())with semanticisValidDate(stopTimeDate)call@ts-checkenabled, now with comprehensive JSDoc annotationsTest File (
check_stop_time.test.cjs)!1withfalsefor better clarityContext
core,github,contextglobals)Validation Results
All validation checks passed before creating this PR:
✅ Formatting:
npm run format:cjs✅ Linting:
npm run lint:cjs✅ Type checking:
npm run typecheck✅ Tests:
npm run test:js -- check_stop_timeLabels
unbloat- Code cleanup and modernizationautomation- Automated workflow improvement