Skip to content

refactor!: modern ES6 rewrite (ESM + node:test, 0 vulns)#25

Merged
pocketrocket merged 1 commit into
mainfrom
fix/es6-modernize
Jun 2, 2026
Merged

refactor!: modern ES6 rewrite (ESM + node:test, 0 vulns)#25
pocketrocket merged 1 commit into
mainfrom
fix/es6-modernize

Conversation

@pocketrocket
Copy link
Copy Markdown
Owner

@pocketrocket pocketrocket commented Jun 2, 2026

From-scratch ES6 modernization — supersedes the long-pending 2019 PR #6.

Changes

  • src/floatify.js: ES6 (const/let/arrow), pure ESM (export default). Algorithm unchanged — all 281 test assertions pass.
  • No Babel (Node runs ES6 natively).
  • Tests migrated to Node's built-in runner (node:test + node:assert), removing mocha + c8. This eliminates the glob deprecation warning and the serialize-javascript (RCE, High) + diff (DoS) advisories at the root → npm audit reports 0 vulnerabilities.
  • eslint flat config (eslint 9); removed babel-eslint, airbnb-es5, .travis.yml, .scrutinizer.yml.
  • devDependencies reduced to just eslint.

⚠️ Breaking

Now ESM-only (export default) — consumers must import instead of require(). → v2.0.0.

Verification (local)

node --test281 passing / 0 failing · npm audit0 · eslint → clean.

From-scratch modernization (supersedes the 2019 Babel PR #6):
- src/floatify.js: ES6 (const/let/arrow), pure ESM (export default).
  Algorithm unchanged — all 281 assertions pass.
- ESM module: package.json "type": "module" + exports. Drops Babel entirely
  (Node runs ES6 natively).
- Tests: migrated to Node's built-in test runner (node:test + node:assert),
  removing mocha + c8 — which eliminates the glob deprecation and the
  serialize-javascript (RCE) / diff (DoS) advisories at the root.
  `npm audit` => 0 vulnerabilities.
- eslint flat config (eslint 9); dropped babel-eslint, airbnb-es5, and the
  legacy .travis.yml / .scrutinizer.yml.

BREAKING: now ESM-only (export default) — consumers must `import` instead of
`require()`. Bumped to 2.0.0.
@pocketrocket pocketrocket merged commit 8774b74 into main Jun 2, 2026
1 check passed
@pocketrocket pocketrocket deleted the fix/es6-modernize branch June 2, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant