Skip to content

fix: integrate strict ESLint config and restore build stability#2709

Open
Adarshkumar0509 wants to merge 3 commits intoOWASP:masterfrom
Adarshkumar0509:major-contribution-eslint-fix
Open

fix: integrate strict ESLint config and restore build stability#2709
Adarshkumar0509 wants to merge 3 commits intoOWASP:masterfrom
Adarshkumar0509:major-contribution-eslint-fix

Conversation

@Adarshkumar0509
Copy link
Contributor

@Adarshkumar0509 Adarshkumar0509 commented Mar 20, 2026

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.

@Adarshkumar0509 Adarshkumar0509 changed the title fix: Integrate eslint-config-love and resolve strict type assertion errors fix: integrate strict ESLint config and restore build stability Mar 20, 2026
@Adarshkumar0509
Copy link
Contributor Author

Hi @sydseter,I have completed the integration of the strict ESLint configuration (eslint-config-love) and resolved the resulting build blockers.
I’ve submitted PR #2709 which includes:
1.) Linting Fixes: Automated and manual refactoring for strict type safety.
2.) Build Restoration: Fixed several unexported stores and controllers that were broken during the initial lint cleanup.
3.) Verification: Confirmed that pnpm run build and pnpm test are now passing successfully.

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!

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.

Integrate the ts-standard for cornucopia.owasp.org

1 participant