Skip to content

Commit 5e8b43f

Browse files
committed
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.
1 parent d4f831d commit 5e8b43f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Jenkinsfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ def runAuditReport() {
5757
'''
5858
}
5959

60+
// For now, only failing on errors. See eslint.config.js for the lint configuration.
61+
def runLint() {
62+
sh label: 'run-lint', script: '''
63+
export PATH=${NODE_HOME_DIR}/bin:$PATH
64+
cd node-client-api
65+
npm ci
66+
npm run lint -- --quiet
67+
'''
68+
}
69+
6070
def runE2ETests() {
6171
sh label: 'run-e2e-tests', script: '''
6272
export JAVA_HOME=$JAVA_HOME_DIR
@@ -123,6 +133,7 @@ pipeline {
123133
agent { label 'nodeclientpool' }
124134
steps {
125135
runAuditReport()
136+
runLint()
126137
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12')
127138
runTests()
128139
runE2ETests()

eslint.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ module.exports = [
3030
"semi": ["error", "always"],
3131

3232
// Modern best practices
33-
"eqeqeq": "error",
33+
"eqeqeq": "warn", // TODO: Fix == vs === issues in follow-up PR
3434
"curly": ["error", "all"], // Require braces for all control structures
35-
"no-unused-vars": "error",
35+
"no-unused-vars": "warn", // TODO: Fix unused variables in follow-up PR
3636
"no-undef": "error",
3737

3838
// ES6+ modernization - GO TIME! 🚀
3939
"prefer-const": "error", // Use const for variables never reassigned
40-
"no-var": "error", // Disallow var, use let/const instead
40+
"no-var": "warn", // TODO: Fix remaining var declarations in follow-up PR
4141

4242
// Spacing rules (disabled for initial setup - TODO: Fix in separate PR)
4343
"arrow-spacing": "off",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"main": "./lib/marklogic.js",
99
"scripts": {
1010
"doc": "gulp doc",
11+
"lint": "gulp lint",
1112
"test:setup": "node etc/test-setup.js",
1213
"test:teardown": "node etc/test-teardown.js",
1314
"test": "gulp test"

0 commit comments

Comments
 (0)