From e136ee685f4f7cded18154d370420afb38cdf765 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 18 Nov 2025 15:38:12 +0100 Subject: [PATCH] fix: improve CI/CD quality checks and fix ESLint configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frontend fixes: - Add eslint-config-next package to devDependencies - Update Jenkinsfile to block deployments on failed lint/tests - Add proper error handling for quality checks This ensures that the deployment only proceeds when all quality checks pass successfully, preventing broken code from being deployed. đŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Jenkinsfile | 19 ++++++++++++++----- package.json | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5cf57e1..ade390d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,11 +75,20 @@ pipeline { } steps { echo "đŸ§Ș Lancement des tests et analyse du code..." - sh ''' - npm ci - npm run lint || echo "⚠ Erreurs ESLint dĂ©tectĂ©es" - npm test || echo "⚠ Tests Ă©chouĂ©s — Ă  vĂ©rifier" - ''' + script { + def lintStatus = sh(script: 'npm ci && npm run lint', returnStatus: true) + def testStatus = sh(script: 'npm test', returnStatus: true) + + if (lintStatus != 0) { + error "❌ ESLint a Ă©chouĂ© - Le dĂ©ploiement est bloquĂ©" + } + + if (testStatus != 0) { + error "❌ Les tests ont Ă©chouĂ© - Le dĂ©ploiement est bloquĂ©" + } + + echo "✅ Tests et lint passĂ©s avec succĂšs" + } } } diff --git a/package.json b/package.json index a0abb91..61d9e50 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@types/react": "19.2.2", "autoprefixer": "^10.4.21", "eslint": "^9.39.1", + "eslint-config-next": "14.2.4", "eslint-plugin-react": "^7.37.5", "globals": "^16.5.0", "jiti": "^2.6.1",