Skip to content

feat: vendor autofixable readable spacing rule - #43

Merged
dmmulroy merged 1 commit into
mainfrom
feat/readable-spacing
Sep 10, 2026
Merged

dmmulroy merged 1 commit into
mainfrom
feat/readable-spacing

Conversation

@dmmulroy

@dmmulroy dmmulroy commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

Ship anti-slop/require-readable-spacing as an opinionated, whitespace-autofixable generic rule. Agents increasingly remove structural blank lines; a formatter preserves that condensed layout rather than restoring readability.

  • Vendor ESLint Stylistic's padding-line-between-statements engine and option types from 435c3ea0fd26a5fef9042c4b36b6e165fbbf8d08.
  • Retain the MIT license (OpenJS Foundation and ESLint Stylistic notices), exact provenance, and a list of local adaptations.
  • Adapt the required helper/type surface to Oxlint; no Stylistic, ESLint, TypeScript-ESLint, or additional parser runtime dependency.
  • Add a thin, no-options anti-slop policy: blank lines between top-level declarations, around multiline bindings, before returns/control flow, and after blocks. Keep short local bindings, consecutive imports, and overload groups compact; preserve documentation attachment and existing blank lines.
  • Enable the rule in installation guidance, sync the distributed assets, and extend asset drift checking to cover licenses/provenance as well as TypeScript.

The vendored engine + helper/type surface is 1,044 lines; the policy wrapper is 47 lines. The duplicate in skill assets is generated distribution, not a second implementation owner.

Verification

  • pnpm check passed: root lint, all RuleTester suites, native CLI integration, typecheck, and skill-asset parity.
  • New exact-output cases cover comments/JSDoc, same-line statements, imports, TypeScript declarations and overloads, Effect-style generators, semicolon-free code, and upstream padding removal.
  • Native CLI integration exercises the exported plugin on multiple files, rejection, autofix, and repeated-fix stability.
  • Consumer verification in cf-twitch on Oxlint 1.80.0 passed root enforcement and lint/Oxfmt convergence, strict typechecking, unit tests, and all three local workerd journeys. Upstream checks use the existing pinned Oxlint 1.78.0.
  • git diff --check passed.

Boundaries

This is structural spacing, not inference of every logical group. It does not add braces, wrap expressions, sort imports, or enable a competing formatter preset. The complete upstream JS/TS test suites are not ported; focused Oxlint compatibility tests and native CLI evidence are included instead. Upstream non-null assumptions remain localized in vendored source; indexed reads have explicit guards for consumers using noUncheckedIndexedAccess.

@dmmulroy
dmmulroy merged commit faf1fbd into main Sep 10, 2026
1 check passed
@dmmulroy
dmmulroy deleted the feat/readable-spacing branch September 10, 2026 13:40
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