config.js flags, storage keys and defaults are ignored by the code
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- backend, developer-experience, testing
Hướng nghiên cứu
Start with js/config.js, then trace the listed reads in js/game.js, js/main.js, js/utils.js, and js/board.js; review docs/ARCHITECTURE.md and .github/CONTRIBUTING.md for project conventions. Run npm test and npm run lint to establish the current behavior. Done when every config entry is used or removed, existing saved games still load through centralized storage keys, and no debug output appears with CONFIG.DEBUG false.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
js/config.js is documented as the central configuration, but most of it is never read. Changing a flag or a storage key there changes nothing.
Where
js/config.js:8-53js/game.js:45-48,js/game.js:91,js/game.js:671,js/game.js:682js/main.js:19-22,js/main.js:68-70,js/main.js:89-90js/utils.js:90-120,js/board.js:80
Details
FEATURES.UNDO_MOVEisfalse, yet undo is always wired and advertised.STORAGE_KEYSdefinesstaticChess.gameStateandstaticChess.settings; the code uses the literalschessGameState,showCoords,showPossibleMoves,showLastMoveandenableSounds.DEFAULT_SETTINGS,BOARD_SIZE,ANIMATIONS,GAME_TIMERandADVANCED_DRAW_DETECTIONare never read. The 300 ms animation is hard-coded atjs/board.js:80.FEATURES.SOUND_EFFECTSis overwritten at startup from the toggle.initializeFeatureModulesforcesCONFIG.DEBUG = trueduring init, so debug lines print in production.game.jslogs with rawconsole.logon every move whiledrag.jsusesdebugLog.saveToLocalStorageandloadFromLocalStoragehave no callers.
Impact
Contributors following the docs flip flags that have no effect. Anyone who later adopts CONFIG.STORAGE_KEYS.GAME_STATE will orphan every saved game.
Suggested fix
- Add a save/load round-trip test for game state.
- Point
CONFIG.STORAGE_KEYSat the keys in use today so no saved data is lost, then routegame.jsandmain.jsthrough the storage helpers. - Read toggle defaults from
DEFAULT_SETTINGS; useCONFIG.ANIMATIONS.PIECE_MOVEinboard.js. - Make
UNDO_MOVEgate the button or delete it; delete flags with no code behind them. - Remove the forced
CONFIG.DEBUG = trueand route logging throughdebugLog.
Each step leaves the app working and can be reviewed alone.
Acceptance criteria
- Every entry in
CONFIGis read somewhere, or removed - Storage keys come from one place and existing saved games still load
- No debug output when
CONFIG.DEBUGis false
Getting started
- Relevant files:
js/config.js,js/game.js,js/main.js,js/utils.js,js/board.js - How to run tests:
npm install, thennpm testandnpm run lint - Related docs:
docs/ARCHITECTURE.md,.github/CONTRIBUTING.md
Filed by repo-audit/full-audit at 8a2c86c. Severity: medium. Effort: M. audit-key: tech-debt|js/config.js|CONFIG
- Ngôn ngữ chính
- JavaScript
- Star
- 4
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/Static_Chess
-
enhancement good first issue severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Static_Chess#53 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TMHSDigital/Static_Chess#49 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
TMHSDigital/Static_Chess#48 ·
-
documentation severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Static_Chess#47 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/Static_Chess#46 ·
Tất cả issue của TMHSDigital/Static_Chess
Issue tương tự
-
good first issue tests
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Download a leaderboard as CSVĐang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
growilabs/growi#12246 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
TMHSDigital/Free-Game-Dev-Assets#301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100