A custom formatter for Stylelint that outputs results in GitLab Code Quality report format, enabling inline annotations in merge requests. This package is specifically designed for GitLab CI/CD pipelines, automatically detecting the environment and generating a gl-codequality.json artifact. Version 1.0.2 is stable but has limited recent activity; it supports Stylelint >=9 and requires GitLab Starter 11.5+. Key differentiator: it bridges Stylelint linting with GitLab's native code quality feature, avoiding manual report parsing.
npm install stylelint-formatter-gitlabNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs the formatter and configures a GitLab CI job to run Stylelint with the custom formatter, generating a code quality report artifact.
Run the stylelint command from a directory where you have write permissions.
Set STYLELINT_CODE_QUALITY_REPORT environment variable to a specific path when running locally.
Update artifact key to 'code_quality' for GitLab >=13.5.
Set environment variable STYLELINT_FORMATTER to a Stylelint formatter name (e.g., 'string') to see results in terminal.
Set the STYLELINT_CODE_QUALITY_REPORT environment variable to a desired file path, e.g., export STYLELINT_CODE_QUALITY_REPORT=gl-codequality.json
Ensure stylelint-formatter-gitlab is installed as a devDependency. Use node_modules/.bin/stylelint or --custom-formatter=./node_modules/stylelint-formatter-gitlab
Reinstall the package: npm install stylelint-formatter-gitlab