Configure eslint job to output Code Quality report
What does this MR do?
- Add a dependency that allows
eslint
to create JSON reports that GitLab Code Quality can import. - Configure the ESLint job to create such a report.
Note: the formatter only creates a report file if it detects that the process is running in CI. (It does this by looking for CI-related env vars.) This means that non-CI-based eslint
runs are not affected and do not create such a file.
Verification
The functionality is demonstrated in a separate MR: !168587 (closed). That MR includes breaking a few lint rules to show that the report is successfully generated.
The report can be seen in a few places:
-
MR widget:
-
- This report can time out with large reports; this is a preexisting issue that is not specific to this particular Code Quality report. It will also be mitigated as we remove CodeClimate-based scanning.
-
MR Changes (diff) view:
Related issues
Dogfood new direction for Code Quality in gitla... (#382153)
This is part of replacing CodeClimate-based scanning with direct usage of scanning tools. Dogfooding this approach will help accelerate the transition for customers.
Documentation will soon include these specific steps: Docs: Add catalog of common tools integrated wi... (!172633 - merged).
Checklist
Pre-merge
Consider the effect of the changes in this merge request on the following:
-
Different pipeline types - Non-canonical projects:
-
gitlab-foss
-
security
-
dev
-
personal forks
-
-
Pipeline performance
If new jobs are added:
-
Change-related rules (e.g. frontend/backend/database file changes): _____ -
Frequency they are running (MRs, main branch, nightly, bi-hourly): _____ -
Add a duration chart to https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations if there are new jobs added to merge request pipelines
This will help keep track of expected pipeline time and cost increases.
Post-merge
-
Consider communicating these changes to the broader team following the communication guideline for pipeline changes