Skip to content

Adopt @e18e/eslint-plugin and format the repo - #12

Merged
antstanley merged 2 commits into
mainfrom
chore/lint-and-format
Jul 25, 2026
Merged

Adopt @e18e/eslint-plugin and format the repo#12
antstanley merged 2 commits into
mainfrom
chore/lint-and-format

Conversation

@antstanley

Copy link
Copy Markdown
Owner

Two independent commits, kept separate so the formatting noise does not bury the logic change.

Adopt @e18e/eslint-plugin and fix the findings it surfaced

Registers the e18e community rules (modernization + performance) through oxlint's jsPlugins. Its ESLint preset configs are flat-config objects oxlint cannot consume, so rules are listed individually.

  • 7 of the 27 rules need typescript-eslint parser services and throw under oxlint — left out with a note in the config.
  • prefer-static-regex is off deliberately. V8 caches compiled patterns by pattern+flags, so hoisting a one-shot literal saves an allocation rather than a recompile, and it fired on 115 ordinary validators and guard clauses.
  • Everything else is fixed: Array.from(matchAll, ...) in the CloudFront alias reconciler drops an intermediate array, and two localeCompare comparators now sort by codepoint — matching the rule already documented in agent-hash.ts, that collation must not depend on host locale/ICU.
  • Two delete sites are suppressed with reasons. In publicClientJwk the key must be absent rather than present-and-undefined, because it is the private key component.

Format the repo with oxfmt

13 files had drifted from the oxfmt config — there is no pre-commit hook, so drift accumulated silently. Whitespace only.

No changeset: both commits are internal-only per DEVELOPMENT.md (lint config, a refactor, formatting).

Verified locally: build, lint, typecheck, knip, --frozen-lockfile, and 331 tests all pass.

🤖 Generated with Claude Code

antstanley and others added 2 commits July 25, 2026 10:15
The plugin carries the e18e community rules for modernizing JS and cutting
avoidable allocations. Registered via oxlint jsPlugins; its ESLint preset
configs are flat-config objects oxlint cannot consume, so the rules are
listed individually.

Seven of its 27 rules need typescript-eslint parser services and throw under
oxlint, so they are left out with a note. prefer-static-regex is off on
purpose: V8 caches compiled patterns by pattern+flags, so hoisting a one-shot
literal saves an allocation rather than a recompile, and it fired on 115
ordinary validators and guard clauses where moving the regex away from the
line that reads it costs more than it buys.

The rest are fixed. Two localeCompare comparators now sort by codepoint,
matching the rule already documented in agent-hash.ts: collation must not
depend on host locale/ICU. The two delete sites are suppressed with reasons —
in publicClientJwk the key must be absent, not present-and-undefined, because
it is the private key component.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Thirteen files had drifted from the oxfmt config — the formatter is not wired
to a pre-commit hook (CI is the enforcement gate), so drift accumulated
silently and showed up as unrelated reflow noise in the previous change.

Whitespace only: no identifiers, literals, or control flow are touched, and
lint, typecheck, build, and the full test suite are unchanged after it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antstanley
antstanley merged commit 9801ff1 into main Jul 25, 2026
1 check passed
@antstanley
antstanley deleted the chore/lint-and-format branch July 25, 2026 08:42
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