-
Notifications
You must be signed in to change notification settings - Fork 37
Fix npm dependency vulnerabilities and modernize codebase to ES6/ES2020 standards #1417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Nov25-Sec-Rollup
Are you sure you want to change the base?
Fix npm dependency vulnerabilities and modernize codebase to ES6/ES2020 standards #1417
Conversation
- Run npm audit fix to auto-fix most vulnerabilities - Remove unused 'prod' package (had high severity async vulnerability) - Upgrade nodemailer from 6.9.14 to 7.0.10 (moderate severity) - Reduced vulnerabilities from 30 to 12 (all low severity, dev dependencies only) - All high and critical vulnerabilities resolved Co-authored-by: skewled <64661963+skewled@users.noreply.github.com>
|
@copilot make sure the appllication is functional with these changes and ensure all code is updated to modern standards. |
- Update TypeScript target from ES2017 to ES2020 (Node 20 compatible) - Convert all CommonJS require() to ES6 imports - Convert module.exports to ES6 export statements - Add type safety improvements (esModuleInterop, strict casing) - Update imports for express, helmet, cors, jwt, multer, password-validator - Fix jira2md import (kept as require due to lack of TS definitions) - All tests pass with same results as before changes Co-authored-by: skewled <64661963+skewled@users.noreply.github.com>
- Add explicit return type Promise<UserRequest> to uploadFileArray - Remove unnecessary type assertions in vulnerability controller - Keep jira-client as require due to CommonJS-only module - Better type safety without compromising functionality Co-authored-by: skewled <64661963+skewled@users.noreply.github.com>
Done! The application has been verified as functional and the code has been modernized to current standards. Functionality verified:
Modernization completed:
Commits: 5a206af (modernization), 0774ba5 (type safety improvements) |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Addressed 18 security vulnerabilities across production and dev dependencies, eliminating all critical, high, and moderate severity issues. Additionally modernized the codebase to current TypeScript and ES6 standards for Node 20.
Security Fixes
Production dependencies:
typeorm0.3.20 → 0.3.27 (fixes SQL injection GHSA-q2pj-6v73-8rgj)body-parser1.20.2 → 1.20.3 (fixes DoS GHSA-qwcr-r2fm-qrc7)nodemailer6.9.14 → 7.0.10 (fixes email domain interpretation GHSA-mm7p-fcc7-pg87)validatorto 13.15.23 (fixes URL validation bypass GHSA-9965-vmph-33xx)prodpackage (contained async prototype pollution GHSA-fwr7-v2mv-hh25)Dev dependencies:
@babel/helpersand@babel/runtimeto 7.28.4 (fixes RegExp complexity GHSA-968p-4wvh-cqc8)cross-spawnto 7.0.6 (fixes ReDoS GHSA-3xgq-45jj-v275)path-to-regexp,glob,js-yamlvia npm auditCode Modernization
TypeScript Configuration:
esModuleInterop,skipLibCheck,forceConsistentCasingInFileNamesfor better type safetyES6 Module System:
require()statements to ES6import(12 files updated)module.exportsto ES6exportstatements (2 files updated)Type Safety Improvements:
Promise<UserRequest>for uploadFileArray)Impact
Verification
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.