jenkins-library: No files found for pattern '*lint.xml'. Configuration error?
I’m trying to run an ESLint pipeline on Jenkins with the SAP Project Piper. To run a linting, I configured the following Jenkins file:
@Library('piper-lib-os') _
node() {
stage('LINT_POC') {
npmExecuteLint script: this
}
}
According to the npmExecuteLint
documentation, that should be enough, but when I run this code on Jenkins, I get the following error:
[LINT] [-ERROR-] No files found for pattern ‘*lint.xml’. Configuration error?
As far as I know, ESLint uses eslintrc.json
as a config file, so how should I generate an *lint.xml
file? And where should I put this file?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (9 by maintainers)
Hi @pubmikeb, this should be possible if you instead use the step
npmExecuteScripts
to execute the script you have defined in thepackage.json
. With your example pipeline, e.g.:I hope this helps.
Hi @pubmikeb,
this seems to be a problem in your
ci-lint
script. I guess it’s because you’re missing the parameter for which files or directories ESLint should be executed. In addition, I guess you cannot usenode eslint
. Instead, either usenpx eslint
ornode ./node_modules/eslint/bin/eslint.js
To execute ESLint in the current folder, e.g.,:In general, I would recommend to first write and test the script locally and when it works locally, use and test it in the pipeline.
Hi @KevinHudemann, do you have any thoughts?
jenkins uses this xml later here https://www.jenkins.io/doc/pipeline/steps/warnings-ng/#recordissues-record-compiler-warnings-and-static-analysis-results
it can, if the same script generate xml locally.