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:
- Touching dummy.js prevents ESLint from complaining that it had no files to lint.
- If you don't want to customize the rules that are used, add
--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:
- If you don't want to customize the rules that are used, add
--no-config-lookup
to the commandline. - In a merge request, GitLab gives you the delta between the issues in your branch and the target branch. Initially, when integrating in this way, the issues found for the target branch are empty, giving you a potentially very long list. Only on subsequent merge request you get a delta that actually related to the changes in that merge request.
- In a typical setup, you don't configure ESLint to ignore issues it detects that you don't care about. Instead, you rely on a code review by a second developer, supported by the info provided by GitLab.
This project uses Semantic Versioning for its version numbering.
Got questions?
Check the discord channel
You could also open an issue here
This is an active open-source project. We are always open to people who want to use the code or contribute to it.
We've set up a separate document for our contribution guidelines.
Thank you for being involved! 😍
The original setup of this repository is by Robbert Müller.
The Build pipeline is large based on Community Hass.io Add-ons by Franck Nijhof.
For a full list of all authors and contributors, check the contributor's page.
This project is licensed under the MIT License by Robbert Müller.