Skip to content

Enforce lint warnings as errors, drop dead bridge stubs, fix replay copy - #93

Merged
min0625 merged 1 commit into
mainfrom
chore/lint-warnings-bridge-cleanup-replay-copy
Jul 29, 2026
Merged

min0625 merged 1 commit into
mainfrom
chore/lint-warnings-bridge-cleanup-replay-copy

Conversation

@min0625

@min0625 min0625 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • lint now runs with --error-on-warnings so warn-level Biome rules (noExcessiveCognitiveComplexity, noAccumulatingSpread, noAwaitInLoops, useTopLevelRegex, noProcessGlobal) actually block commits instead of printing and passing.
  • Removed bridge.js's showAd()/buy() Phase 3 stubs — zero callers for their whole life, and buy()'s bare Promise.reject() would have been an unhandled rejection if anything had called it. Interface shape for Phase 3 stays documented in the design doc.
  • Fixed replayNote copy from 「重玩不再獲得金幣」to 「重玩不再重複獲得金幣」— the old wording was inaccurate: unfound bonus words still pay out on replay (foundBonusWords tracks per-word, once ever), only the one-time completion reward is withheld.
  • Docs updated to match (CLAUDE.md, README, both design docs, serena memory).

Test plan

  • bun run check (lint + test) passes locally, including the new --error-on-warnings flag
  • prek run --all-files passes via commit hook

- lint gains --error-on-warnings so warn-level Biome rules (e.g.
  noExcessiveCognitiveComplexity) actually block instead of printing and
  passing.
- Remove bridge.js's showAd()/buy() Phase 3 stubs: zero callers ever, and
  buy()'s bare Promise.reject() would have been an unhandled rejection if
  called.
- replayNote copy now says "不再重複獲得金幣" instead of "不再獲得金幣" —
  the old wording was flatly wrong since unfound bonus words still pay out
  on replay; only the one-time completion reward is withheld.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@min0625
min0625 merged commit 863fc54 into main Jul 29, 2026
1 check passed
@min0625
min0625 deleted the chore/lint-warnings-bridge-cleanup-replay-copy branch July 29, 2026 09:59
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Make Biome warnings fatal; remove unused bridge stubs; fix replay note copy

⚙️ Configuration changes 🐞 Bug fix 📝 Documentation ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Make Biome warn-level rules fail lint via --error-on-warnings.
• Remove dead bridge.showAd()/bridge.buy() stubs to shrink API and avoid unsafe rejection.
• Fix replayNote wording to reflect “no duplicate rewards”, not “no rewards at all”.
Diagram

graph TD
  A["Developer / CI (prek)"] --> B["bun run check"] --> C["bun run lint (error on warnings)"] --> D["Biome check"]
  B --> E["bun test"]
  G["Game modules"] --> F["bridge API"]
  G --> H["strings (replayNote)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Promote warn-level Biome rules to "error" in biome.json
  • ➕ Makes enforcement explicit per-rule (no reliance on a CLI flag).
  • ➕ Allows selectively keeping some warnings non-blocking.
  • ➖ More churn and ongoing maintenance across the config as the rule set evolves.
  • ➖ Harder to keep consistency between local runs and any other tooling entrypoints.
2. Keep bridge Phase 3 stubs but make them safe no-ops
  • ➕ Preserves a placeholder API surface for future work without re-adding methods later.
  • ➕ Avoids potential downstream compilation issues if someone had started using them.
  • ➖ Still forces docs and mental overhead to track unused surface area.
  • ➖ No-op stubs can hide missing integrations during Phase 3 work.

Recommendation: Keep the PR’s approach: --error-on-warnings is a centralized, low-maintenance way to ensure warn-level rules actually gate commits, and it avoids silently “green but ineffective” linting. Removing unused bridge stubs is also the right tradeoff here because there are no callers and the previous Promise.reject() behavior would be actively harmful if invoked; the Phase 3 interface shape is better preserved in the design docs than in dead code.

Files changed (8) +21 / -21

Bug fix (1) +4 / -1
strings.jsFix replayNote copy to say “no duplicate coins” +4/-1

Fix replayNote copy to say “no duplicate coins”

• Updates 'replayNote' to 「重玩不再重複獲得金幣」 and adds comments explaining the reward model (completion reward withheld on replay, but new bonus words still pay once). This prevents misleading UX messaging.

src/strings.js

Refactor (1) +0 / -6
bridge.jsRemove unused Phase 3 bridge stubs (showAd/buy) +0/-6

Remove unused Phase 3 bridge stubs (showAd/buy)

• Deletes 'showAd()' and 'buy()' placeholder methods from the platform bridge API. This reduces dead surface area and eliminates the risk of an unhandled rejection from the previous 'buy()' stub.

src/bridge.js

Documentation (5) +16 / -13
project-overview.mdAlign overview notes with replayNote wording and doc-source-of-truth +1/-1

Align overview notes with replayNote wording and doc-source-of-truth

• Updates the UI patch note to reference 'replayNote' rather than duplicating the exact sentence. Adds a reminder that copy should be maintained in the UI doc table to avoid drift.

.serena/memories/project-overview.md

CLAUDE.mdDocument lint warnings-as-errors and remove ads/IAP from bridge overview +4/-2

Document lint warnings-as-errors and remove ads/IAP from bridge overview

• Clarifies that 'bun run lint' includes warnings and relies on '--error-on-warnings' to prevent warn-level rules from being non-blocking. Updates the bridge module description to reflect the removal of the Phase 3 ad/IAP stubs and why the interface shape lives in design docs instead.

CLAUDE.md

README.mdUpdate lint command behavior and bridge scope in project overview +2/-2

Update lint command behavior and bridge scope in project overview

• Updates 'bun run lint' documentation to note warnings now block. Adjusts the 'bridge.js' description to remove ads/IAP from the Phase 1 web bridge scope.

README.md

word-puzzle-game-design.mdRemove Phase 3 bridge stubs from design snippet; clarify replay reward semantics +6/-5

Remove Phase 3 bridge stubs from design snippet; clarify replay reward semantics

• Updates the documented file tree and bridge snippet to remove 'showAd()'/'buy()' stub methods and adds rationale for keeping only the interface shape in docs. Fixes acceptance checklist language for replay rewards and adds explicit validation that new bonus words still pay out on replay.

docs/word-puzzle-game-design.md

word-puzzle-ui-screens.mdCorrect replay reward explanation and replayNote copy table entry +3/-3

Correct replay reward explanation and replayNote copy table entry

• Clarifies that replay does not duplicate completion rewards, but still awards newly found bonus words. Updates the 'replayNote' copy reference in the copy table accordingly.

docs/word-puzzle-ui-screens.md

Other (1) +1 / -1
package.jsonMake Biome warnings fail lint via --error-on-warnings +1/-1

Make Biome warnings fail lint via --error-on-warnings

• Updates the 'lint' script to run 'biome check --error-on-warnings .', ensuring warn-level rules block commits/CI rather than printing and exiting successfully.

package.json

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

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