Repository navigation
[FSSDK-13494] Update dev dependencies and move to ESLint flat config - #1194
Raju Ahmed (raju-opti) wants to merge 8 commits into
Conversation
- ESLint 8 -> 10 with eslint.config.js (replaces .eslintrc.js and .eslintignore); typescript-eslint 8 replaces @typescript-eslint/* 5. Local rules are registered as an inline plugin, so eslint-plugin-local-rules is removed. - mocha 10 -> 11.8 and nyc 15 -> 17.1, the newest versions that still support Node 18. - Remove unused coveralls-next, ts-loader and webpack. coveralls-next pinned js-yaml 4.2.0; mocha now gets 4.3.2. - Bump @types/node, happy-dom, minimatch, vite, and webdriverio in tests/browser. - Fix code flagged by the new lint rules, including two `not.toHaveBeenCalled` assertions in the decision service spec that never ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mocha-lcov-reporter - Run `npm update --save`: dev dependencies move to the newest versions their current ranges allow (e.g. rolldown 1.3.3, netinfo 11.5.2, nise 6.1.5, tslib 2.9.1, typescript 4.9.5), and the lockfile picks up newer transitive versions. - Remove mocha-lcov-reporter. Nothing uses it; coverage/lcov.info comes from nyc's lcov reporter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
87545e5 to
c7f02d1
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Node 18 compatibility remains unverified for ESLint 10 and happy-dom 21, which require Node 20+, and the WebdriverIO 10 browser matrix still needs confirmation.
No open issues 🎉
1 file not reviewed
tests/browser/package-lock.json: Generated file
What changed in this PR
Modernizes the SDK’s development tooling and migrates ESLint to flat configuration, with no intended SDK behavior changes.
Changes:
- Updates development and browser-test dependencies and removes unused tooling.
- Replaces legacy ESLint configuration with flat config and inline local rules.
- Fixes two inactive test assertions and makes small lint-driven cleanups.
| File | Description |
|---|---|
| tests/browser/package.json | Upgrades WebdriverIO to version 10. |
| tests/browser/package-lock.json | Locks updated browser-test dependencies. |
| package.json | Updates and trims development dependencies. |
| lib/tests/uuid_cjs_shim.js | Updates lint suppression comments. |
| lib/project_config/optimizely_config.ts | Uses constant map bindings. |
| lib/odp/segment_manager/odp_segment_api_manager.ts | Types parsed JSON as unknown. |
| lib/import.react_native/react-native-get-random-values.ts | Updates a lint suppression comment. |
| lib/import.react_native/fast-text-encoding.ts | Updates a lint suppression comment. |
| lib/import.react_native/@react-native-async-storage/async-storage.ts | Updates a lint suppression comment. |
| lib/core/decision_service/index.spec.ts | Invokes two previously inactive assertions. |
| eslint.config.js | Adds flat configuration and inline local rules. |
| eslint-local-rules/require-platform-declaration.js | Updates configuration guidance and lint comments. |
| eslint-local-rules/README.md | Documents inline rule registration. |
| eslint-local-rules/index.js | Updates the plugin registration comment. |
| CONTRIBUTING.md | Links to the new ESLint configuration. |
| .eslintrc.js | Removes legacy ESLint configuration. |
| .eslintignore | Moves ignore patterns into flat configuration. |
Review effort: Balanced
The posttest hook ran lint in every unit_tests matrix job. ESLint 10 needs Node 20+, so the Node 18 job crashed in the lint step. The lint job already runs npm run lint, so the unit_tests jobs don't need to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cross-spawn 7.0.6 has a critical advisory (GHSA-ghv9-86vm-4v8m): command injection on Windows when spawning batch files, fixed in 7.1.0. It's a dev dependency of eslint, nyc and react-native's tooling. 7.1.1 is younger than min-release-age, so it's pinned in the lockfile directly. npm ci installs locked versions without the age check, but npm update would move it back to 7.0.6 until 7.1.1 is 7 days old (5 Dec). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mocha 11 requires serialize-javascript ^6.0.2, which has high-severity advisories fixed only in 7.1.3+. mocha 12 accepts 7.x but needs Node 20, and we still test on Node 18. serialize-javascript 7's only breaking change is requiring Node 20; its API is the same. mocha only loads it in parallel mode, which our test scripts don't use, so the Node 18 jobs never load it. Remove this override when moving to mocha 12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| "eslint-config-prettier": "^6.15.0", | ||
| "eslint-plugin-prettier": "^3.4.1", | ||
| "globals": "^17.14.0", | ||
| "happy-dom": "^21.0.4", |
There was a problem hiding this comment.
happy-dom 21 declares engines.node: ">=20.0.0". The Node 18 job passes now, but nothing guarantees that. Since happy-dom 21 doesn't support Node 18, any patch release could break it without a breaking-change notice
There was a problem hiding this comment.
Yeah. Older versions have a bunch of security advisories. Let's just pin this specific version as this works.
Summary
Updates dev dependencies to clear npm audit findings (28 → 9, no high or critical left) and moves to ESLint flat config. Nothing changes for SDK users.
eslint.config.jsreplaces.eslintrc.jsand.eslintignore,typescript-eslint8 replaces@typescript-eslint/*5, and the local rules are an inline plugin, soeslint-plugin-local-rulesis removed.npm test: removed theposttesthook. ESLint 10 needs Node 20, so it crashed the Node 18 unit test job, and thelintjob already runs lint.expect(...).not.toHaveBeenCalledcalls indecision_service/index.spec.tswere missing(), so they never asserted. Plus smallprefer-constandunknownfixes.js-yaml4.3.2, which fixes a high advisory.ts-loaderandwebpack: unused; the build istsc+ rolldown.@types/node20,happy-dom21,minimatch11,vite6.4.6 andwebdriverio10 (tests/browser). The remaining dev dependencies update within their ranges.cross-spawn7.1.1 (lockfile only): fixes a critical Windows command-injection advisory (CVE-2026-137199). It's younger than the 7-daymin-release-age, so it's pinned in the lockfile, andnpm updatewould revert it until 5 Dec.serialize-javascriptoverride → 7.1.4: mocha 11 requires^6.0.2, which has high advisories. Only mocha's parallel mode loads it, and we don't use that. Remove the override when moving to mocha 12.Issues
🤖 Generated with Claude Code