From 3716a743678f04eee7aeab95d4d51cc64f5377e6 Mon Sep 17 00:00:00 2001 From: Rob Rudin Date: Mon, 20 Oct 2025 12:13:24 -0400 Subject: [PATCH] MLE-24763 Enabling lint in Jenkinsfile Using a very minimal strategy now. There are 3 TODO's for things that ought to become errors soon. Will open separate Jira tickets for those. --- Jenkinsfile | 11 +++++++++++ eslint.config.js | 6 +++--- package.json | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a22e542e..5c21ba9b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,6 +57,16 @@ def runAuditReport() { ''' } +// For now, only failing on errors. See eslint.config.js for the lint configuration. +def runLint() { + sh label: 'run-lint', script: ''' + export PATH=${NODE_HOME_DIR}/bin:$PATH + cd node-client-api + npm ci + npm run lint -- --quiet + ''' +} + def runE2ETests() { sh label: 'run-e2e-tests', script: ''' export JAVA_HOME=$JAVA_HOME_DIR @@ -123,6 +133,7 @@ pipeline { agent { label 'nodeclientpool' } steps { runAuditReport() + runLint() runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12') runTests() runE2ETests() diff --git a/eslint.config.js b/eslint.config.js index 041e8fb3..a1ba8f26 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -30,14 +30,14 @@ module.exports = [ "semi": ["error", "always"], // Modern best practices - "eqeqeq": "error", + "eqeqeq": "warn", // TODO: Fix == vs === issues in follow-up PR "curly": ["error", "all"], // Require braces for all control structures - "no-unused-vars": "error", + "no-unused-vars": "warn", // TODO: Fix unused variables in follow-up PR "no-undef": "error", // ES6+ modernization - GO TIME! 🚀 "prefer-const": "error", // Use const for variables never reassigned - "no-var": "error", // Disallow var, use let/const instead + "no-var": "warn", // TODO: Fix remaining var declarations in follow-up PR // Spacing rules (disabled for initial setup - TODO: Fix in separate PR) "arrow-spacing": "off", diff --git a/package.json b/package.json index 9a007a9a..b8e2083f 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "main": "./lib/marklogic.js", "scripts": { "doc": "gulp doc", + "lint": "gulp lint", "test:setup": "node etc/test-setup.js", "test:teardown": "node etc/test-teardown.js", "test": "gulp test"