chore(deps): babel coverage, devDeps cleanup, eslint 10 flat config#15
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Updates the repo’s dev tooling baseline to use Babel/Istanbul coverage, ESLint 10 flat config, and a simplified Wallaby setup, while cleaning up devDependencies and tightening coverage enforcement.
Changes:
- Switched Jest coverage to Babel with scoped collection + 100% global thresholds; added a test to cover the module export guard branch.
- Migrated from legacy
.eslintrc.jsto ESLint 10 flat config with updated plugins/globals. - Simplified
wallaby.jsto auto-detect Jest and removed duplicated config.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wallaby.js | Removes manual Wallaby config and relies on Jest auto-detection to prevent drift. |
| src/index.test.js | Adds a Jest test to cover the module export guard behavior. |
| setup.js | Removes unused globals and introduces a RetryError global for tests/lint parity. |
| package.json | Updates linting toolchain deps and removes unused devDependencies; adds direct lodash pin. |
| jest.config.js | Switches to Babel coverage provider, scopes coverage collection, and enforces 100% thresholds. |
| eslint.config.js | Introduces ESLint 10 flat config with node globals + Jest-only overrides for tests. |
| .eslintrc.js | Removes legacy ESLint configuration. |
- switch jest coverageProvider v8 -> babel for honest branch coverage (v8 collapsed the optional-chaining export guard, hiding an uncovered path); scope coverage to src/ (exclude setup.js scaffolding); enforce 100% threshold; add 1 test (module-exports guard) to reach 100% branches - upgrade eslint 8.57.1 -> 10 (^10.6.0), eslint-plugin-jest 27 -> 29 (^29.15.4), add @eslint/js ^10.0.1 + globals ^17.7.0; migrate .eslintrc.js -> flat eslint.config.js (node-only globals); disable newly enforced rules to preserve prior behavior (no source changes) - bump lint-staged 16 -> 17 (^17.0.8; dev-only git-hook runner, Node >=22) - remove unused devDeps: eslint-config-prettier, eslint-plugin-prettier, eslint-formatter-table, prettier-eslint, node-fetch, semver (+ crypto/ cache/jsonwebtoken globals); pin lodash 4.18.1 direct (was transitive) - wallaby.js: autoDetect jest instead of duplicating setup.js (fixes drift) - hard-refresh lockfile via Artifactory; npm audit 0 vulnerabilities Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
package.json declares moment-timezone; requiring plain 'moment' relied on a transitive dep. Aligns test setup with the declared dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…obals - NODE_DEV restore now uses try/finally and restores to the module-scope 'TEST' value (never assigns undefined). - Remove unused eslint globals `cache` (not defined in setup.js) and `rules` (JPMC-specific function-bundling global, not part of the template). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7c87c41 to
ecbaff0
Compare
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.
Before this PR
jest.config.jsusedcoverageProvider: 'v8'with nocollectCoverageFromand no threshold. v8 collapsed the optional-chaining export guard insrc/index.js, reporting a false 100% while a branch was actually uncovered.8.57.1(legacy.eslintrc.js, EOL, carrying transitive advisories),eslint-plugin-jest27,lint-staged16.eslint-config-prettier,eslint-plugin-prettier,eslint-formatter-table,prettier-eslint,node-fetch,semver.lodashwas only present transitively (viaprettier-eslint). setup.js injected unusedcrypto/cacheglobals;.eslintrc.jsdeclared unusedjsonwebtokenglobal.wallaby.jsduplicated the setup.js globals/coverage config by hand, free to drift from the Jest config.After this PR
coverageProvider: 'babel'(honest branch coverage + Wallaby parity),collectCoverageFrom: ['src/**/*.js'], enforced 100% threshold. Added 1 test (module-exports guard, re-require withNODE_DEVunset) to close the newly-visible branch. Coverage 100% all metrics; 2 tests pass.^10.6.0with a flateslint.config.js(node-only globals),eslint-plugin-jest^29.15.4, added@eslint/js^10.0.1+globals^17.7.0. Newly-enforced rules disabled to preserve prior behavior sonpx eslint .passes with zero source changes.lint-stagedbumped to^17.0.8.lodashpinned direct at4.18.1(Segment runtime global).moment-timezone^0.5.31left pinned.jest-fetch-mockkept.wallaby.jsreduced toautoDetect: ['jest'](single source of truth = Jest config).npm audit0 vulnerabilities.Reason that prompted this change
Test Plan
npx jest-> 100% statements/branches/functions/lines, 2 tests pass.npx eslint .-> exit 0, zero code changes (no--fixchurn).npm audit-> 0 vulnerabilities.resolvedhosts arenpmjs.artifacts.twilio.com.npm test) exercised by the commit itself and passed.src/index.js) modified; coverage closed via tests only.🤖 Generated with Claude Code