The image is for running ESLint. ESLint is installed in /app/ in case you need to customize the install before usage.
This integration runs as a pipeline job. If any issues are found that are not silenced by the configuration, the job (and pipeline) fails.
eslint:
needs: []
image: registry.gitlab.com/pipeline-components/eslint:latest
before_script:
- touch dummy.js
script:
- eslint --color .
Notes:
--no-config-lookup
to the commandline.This integration runs as a pipeline job, too. Other than the simple integration above, it doesn’t fail the job if any issues are found. Instead, it makes all issues available via GitLab’s Code Quality feature. That will display the changes in the set of found issues inside the Merge Request view, to support in code reviews before merging.
eslint:
artifacts:
reports:
codequality: gl-codequality.json
image: registry.gitlab.com/pipeline-components/eslint:latest
needs: []
script:
# ESLint exits with 1 in case it finds any issues, which is not an
# error in the context of the pipeline. If it encounters an internal
# problem, it exits with 2 instead.
- eslint --format gitlab . || [ $? == 1 ]
Notes:
--no-config-lookup
to the commandline.