How to integrate Eslint with jenkins? -
i trying integrate eslint jenkins, didn't found links in google, please me this.
awaiting favorable response.
thanks, siva ramanjaneyulu vegi
you need export eslint report xml file , use of violation/lint reporter plugins jenkins has available checkstyle, warnings or violations plugins.
for eslint prefer using checkstyle plugin in jenkins.
so way export eslint reports jenkins doing following:
- from jenkins job's configuration screen, add build step of "execute shell"
- add following command it:
eslint -c config.eslintrc -f checkstyle apps/**/* > eslint.xml
(replaceapps/**/*
path of app files) - add post build action of "publish checkstyle analysis results" , input path "eslint.xml" file got exported. (this assuming have installed checkstyle plugin in jenkins)
then, when execute job able see eslint report against files got executed.
understanding have done with:
eslint -c config.eslintrc -f checkstyle apps/**/* > eslint.xml
-c config.eslintrc
point.eslintrc
configuration file , uses whatever specify there use. (please see above eslint link i've provided)-f checkstyle
specify eslint format should use on report, please see available formats in linkapps/**/*
path of files eslint check (**/* pattern files , folder)> filename
export cli arg results going stored each time build run
update:
with latest version of eslint can export output whatever file you'd following command line argument:
-o your_file.file_format
please refer documentation
note:
in case invocation eslint has errors, command return value of 1
, , build marked failed, not wanted. avoid this, append following: || true
Comments
Post a Comment