Jenkins: How do I lint Jenkins pipelines from the command line? - Stack Overflow https://www.jenkins.io/doc/book/pipeline/development/

起動中の note/Jenkins にcurlやsshしてvalidateのAPIを叩くとチェックできる

Linting via the CLI with SSH

# ssh (Jenkins CLI)
# JENKINS_SSHD_PORT=[sshd port on controller]
# JENKINS_HOSTNAME=[Jenkins controller hostname]
ssh -p $JENKINS_SSHD_PORT $JENKINS_HOSTNAME declarative-linter < Jenkinsfile

Linting via HTTP POST using curl

# curl (REST API)
# Assuming "anonymous read access" has been enabled on your Jenkins instance.
# JENKINS_URL=[root URL of Jenkins controller]
# JENKINS_CRUMB is needed if your Jenkins controller has CRSF protection enabled as it should
JENKINS_CRUMB=`curl "$JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)"`
curl -X POST -H $JENKINS_CRUMB -F "jenkinsfile=<Jenkinsfile" $JENKINS_URL/pipeline-model-converter/validate

それをnpmコマンドでできるようにしたものがこちら

Jenkinsfileのlintで救える命がある jflint - npm

linter

https://github.com/nvuillam/npm-groovy-lint というのもある