Skip to content

Remove code comments and fail lint on new ones - #2

Merged
Byntham merged 2 commits into
mainfrom
remove-code-comments
Nov 5, 2026
Merged

Byntham merged 2 commits into
mainfrom
remove-code-comments

Conversation

@Byntham

@Byntham Byntham commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Code comments in t3type drifted and repeated what the code said. Now there are none, and npm run lint fails if one comes back. If code needs explaining, it gets a clearer name or a test.

  • scripts/no-comments.mjs finds comments in TS, TSX, JS, CSS and HTML, including inline <script> and <style>. It uses the TypeScript parser, so // inside strings, regexes and JSX text is not flagged.
  • Comments that carried meaning became names (GameMs and RealMs types, LineCounts, substitutionCost, named play-test runs) or vitest tests (typo alignment, WPM math, thread draws, the lint rule itself).
  • A GitHub Actions workflow runs lint, typecheck and unit tests on pushes to main and on PRs.
  • File provenance headers ("From T3 Code ... (MIT)") are gone. THIRD_PARTY.md already lists those files and the MIT notice.

Proof: lint, build and 24 vitest tests pass. The Playwright play test passes all 25 checks. New lint tests fail on the first version of the scanner.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Byntham and others added 2 commits November 5, 2026 00:37
Every comment in src, tests, index.html and vite.config.ts is gone. Where a
comment carried meaning, it became a name (GameMs/RealMs types, LineCounts,
substitutionCost, named play-test runs) or a unit test.

npm run lint runs scripts/no-comments.mjs, which uses the TypeScript parser
for scripts and small scanners for CSS and HTML. Vitest covers the rule and
the game logic. A GitHub Actions workflow runs lint, typecheck and unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Byntham
Byntham merged commit 4d6d372 into main Nov 5, 2026
1 check passed
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