fix: integrate strict ESLint config and restore build stability#2709
Open
Adarshkumar0509 wants to merge 3 commits intoOWASP:masterfrom
Open
fix: integrate strict ESLint config and restore build stability#2709Adarshkumar0509 wants to merge 3 commits intoOWASP:masterfrom
Adarshkumar0509 wants to merge 3 commits intoOWASP:masterfrom
Conversation
…ct type assertions
Contributor
Author
|
Hi @sydseter,I have completed the integration of the strict ESLint configuration (eslint-config-love) and resolved the resulting build blockers. I utilized the AI-assisted refactoring approach as suggested in the issue to handle the complex type-assertion logic in deckService.ts. Ready for your review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2647
Description
This PR integrates the new strict ESLint configuration into the build pipeline and, more importantly, restores project stability following the initial automated linting cleanup.
Key Technical Contributions:
Build Restoration: -
Manually identified and restored critical exports (Stores, Controllers, and Utils) that were accidentally stripped during the automated eslint --fix process. This was essential to move the project from a "Hard Crash" state back to a successful production build.
Strict Typing Refactor:-
Performed extensive manual refactoring in src/lib/services/deckService.ts and src/routes/api/lang/[edition]/[version]/server.test.ts to satisfy eslint-config-love without resorting to any overrides.
Safe Logic Implementation:-
Re-wrote the YAML parsing logic in deckService.ts. The new implementation uses safe JS traversal to satisfy the linter while maintaining the runtime integrity required to parse all 80/251 cards correctly.
Naming Alignment:-
Synchronized naming conventions (e.g., DevGuideMapping) between logic files and Svelte components to resolve UI compilation errors.
Testing & Verification:
Production Build: Confirmed pnpm run build now completes successfully, generating the sitemap and production assets.
Logic Tests: All 29 core logic tests are passing green.
Coverage Note: Global coverage is currently at ~67%. This is a known baseline issue in the repo (e.g., authorController.ts at 0%). Restoring the unexported logic allows the build to pass, even though these areas lack legacy unit tests.
AI Disclosure
In alignment with the suggestion from @sydseter in the related issue, I utilized an AI assistant Chatgpt as a technical peer to help navigate the most complex manual refactoring required by the strict eslint-config-love rules. Specifically, I used AI to help brainstorm safe TypeScript patterns for bridging dynamic YAML outputs into strict Card types without breaking runtime logic. All resulting code was manually reviewed, integrated, and verified against the local build environment.