From d908f6b1b4f7a7530848285a4a8ef994daf8483d Mon Sep 17 00:00:00 2001 From: Do Siki Date: Sat, 22 Aug 2026 12:37:22 +0200 Subject: [PATCH] chore(quality): type-check and lint gates in pre-deploy, clean lint/tsc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pre-deploy suite now runs tsc --noEmit and eslint; any failure aborts the release - fix all TypeScript errors (FooterConfig.copyright removed after the CMS move; test guards/casts) - fix all ESLint errors: and in Header/Footer, remove unused imports and explicit any in src - eslint config relaxes no-explicit-any/no-require-imports/no-unused-vars for test and CommonJS config files (legitimate usage) Closes MITHOME-81 --- proto/eslint.config.mjs | 19 +++++++++++++++++++ proto/src/__tests__/integration.test.ts | 3 ++- proto/src/app/page.tsx | 3 +-- proto/src/components/Footer.tsx | 7 ++++--- proto/src/components/Header.tsx | 12 ++++++++---- proto/src/lib/logger.test.ts | 5 +++-- proto/src/lib/logger.ts | 2 +- proto/src/types/site.ts | 2 +- scripts/pre-deploy-tests.sh | 2 ++ 9 files changed, 41 insertions(+), 14 deletions(-) diff --git a/proto/eslint.config.mjs b/proto/eslint.config.mjs index 719cea2..d2ade2d 100755 --- a/proto/eslint.config.mjs +++ b/proto/eslint.config.mjs @@ -20,6 +20,25 @@ const eslintConfig = [ "next-env.d.ts", ], }, + { + // WHY: test suites legitimately use `any` mocks, jest globals and CommonJS + // require(); jest/playwright config files are CommonJS by design. Relax the + // strict rules there so lint failures point at real production-code issues. + files: [ + "**/*.test.ts", + "**/*.test.tsx", + "jest.config*.js", + "jest.setup*.js", + "jest.globalSetup*.js", + "playwright.config.ts", + ], + rules: { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-require-imports": "off", + "@typescript-eslint/no-unused-vars": "off", + "react/display-name": "off", + }, + }, ]; export default eslintConfig; diff --git a/proto/src/__tests__/integration.test.ts b/proto/src/__tests__/integration.test.ts index 4ad251f..1958332 100755 --- a/proto/src/__tests__/integration.test.ts +++ b/proto/src/__tests__/integration.test.ts @@ -91,7 +91,8 @@ describe('Docker Environment Integration Tests', () => { const mozditDb = mongoClient.db('mozdit') const siteConfig = await mozditDb.collection('site_config').findOne() - + + if (!siteConfig) throw new Error('site_config document not found') expect(siteConfig).toBeTruthy() expect(siteConfig).toHaveProperty('type', 'site_config') expect(siteConfig).toHaveProperty('environment', 'development') diff --git a/proto/src/app/page.tsx b/proto/src/app/page.tsx index bf1e9a1..2a62627 100755 --- a/proto/src/app/page.tsx +++ b/proto/src/app/page.tsx @@ -1,4 +1,3 @@ -import { siteConfig } from '@/config/site' import { content } from '@/content' const { home: pageContent } = content.pages @@ -94,7 +93,7 @@ export default function Home() {
- {pageContent.about.usps.map((usp: any, index: number) => ( + {pageContent.about.usps.map((usp, index) => (
{/* Company Info */}
- - +