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:

  1. from jenkins job's configuration screen, add build step of "execute shell"
  2. add following command it: eslint -c config.eslintrc -f checkstyle apps/**/* > eslint.xml (replace apps/**/* path of app files)
  3. 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 link
  • apps/**/* path of files eslint check (**/* pattern files , folder)
  • > filename export cli arg results going stored each time build run

enter image description here

enter image description here

enter image description here

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

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -