fix: improve CI/CD quality checks and fix ESLint configuration
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 <noreply@anthropic.com>
This commit is contained in:
parent
d2e6894b77
commit
e136ee685f
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
|
|
@ -75,11 +75,20 @@ pipeline {
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "🧪 Lancement des tests et analyse du code..."
|
echo "🧪 Lancement des tests et analyse du code..."
|
||||||
sh '''
|
script {
|
||||||
npm ci
|
def lintStatus = sh(script: 'npm ci && npm run lint', returnStatus: true)
|
||||||
npm run lint || echo "⚠️ Erreurs ESLint détectées"
|
def testStatus = sh(script: 'npm test', returnStatus: true)
|
||||||
npm test || echo "⚠️ Tests échoués — à vérifier"
|
|
||||||
'''
|
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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
"@types/react": "19.2.2",
|
"@types/react": "19.2.2",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"eslint": "^9.39.1",
|
"eslint": "^9.39.1",
|
||||||
|
"eslint-config-next": "14.2.4",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"globals": "^16.5.0",
|
"globals": "^16.5.0",
|
||||||
"jiti": "^2.6.1",
|
"jiti": "^2.6.1",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user