{"id":42028,"library":"stylelint-formatter-gitlab","title":"stylelint-formatter-gitlab","description":"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.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","stylelint","stylelint-formatter","stylelintformatter","gitlab","gitlab-ci"],"install":[{"cmd":"npm install stylelint-formatter-gitlab","lang":"bash","label":"npm"},{"cmd":"yarn add stylelint-formatter-gitlab","lang":"bash","label":"yarn"},{"cmd":"pnpm add stylelint-formatter-gitlab","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency >=9; the formatter is a plugin for Stylelint","package":"stylelint","optional":false}],"imports":[{"note":"This is not a programmatic API. It is used as a CLI custom formatter only.","wrong":"const formatter = require('stylelint-formatter-gitlab')","symbol":"default","correct":"No import in code; used via --custom-formatter"}],"quickstart":{"code":"npm install --save-dev stylelint stylelint-formatter-gitlab\n# or: yarn add --dev stylelint stylelint-formatter-gitlab\n\n# In .gitlab-ci.yml:\nstylelint:\n  image: node:10-alpine\n  script:\n    - npm ci\n    - npx stylelint --custom-formatter=node_modules/stylelint-formatter-gitlab .\n  artifacts:\n    reports:\n      codequality: gl-codequality.json","lang":"yaml","description":"Installs the formatter and configures a GitLab CI job to run Stylelint with the custom formatter, generating a code quality report artifact."},"warnings":[{"fix":"Run the stylelint command from a directory where you have write permissions.","message":"The formatter writes to a file (gl-codequality.json) by default; ensure the working directory is writable.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set STYLELINT_CODE_QUALITY_REPORT environment variable to a specific path when running locally.","message":"The formatter expects to run in a GitLab CI context to detect the artifact path; it may not work outside of GitLab CI.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update artifact key to 'code_quality' for GitLab >=13.5.","message":"The GitLab CI configuration example uses 'codequality' artifact, which was renamed to 'code_quality' in later GitLab versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Set environment variable STYLELINT_FORMATTER to a Stylelint formatter name (e.g., 'string') to see results in terminal.","message":"The formatter does not output anything to stdout by default; use STYLELINT_FORMATTER env var for console output.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.2':44 '11.5':60 '9':55 'activ':51 'annot':21 'artifact':42 'automat':34 'avoid':74 'bridg':64 'ci':87 'ci/cd':32 'code':15,71 'custom':6 'design':29 'detect':35 'differenti':62 'enabl':19 'environ':37 'featur':73 'format':18 'formatt':3,7,82 'generat':39 'gitlab':4,14,31,58,68,84,86 'gitlab-ci':85 'gl-codequality.json':41 'inlin':20 'javascript':78 'key':61 'limit':49 'lint':66 'manual':75 'merg':23 'nativ':70 'output':11 'packag':26 'pars':77 'pipelin':33 'qualiti':16,72 'recent':50 'report':17,76 'request':24 'requir':57 'result':12 'specif':28 'stabl':46 'starter':59 'stylelint':2,9,54,65,79,81 'stylelint-formatt':80 'stylelint-formatter-gitlab':1 'stylelintformatt':83 'support':53 'version':43","created_at":"2026-06-04T18:55:16.225878+00:00","updated_at":"2026-06-04T18:55:16.225878+00:00","problems":[{"fix":"Set the STYLELINT_CODE_QUALITY_REPORT environment variable to a desired file path, e.g., export STYLELINT_CODE_QUALITY_REPORT=gl-codequality.json","cause":"The formatter cannot automatically detect the GitLab CI artifact path; this error occurs when not running in GitLab CI or when the artifact is not configured.","error":"Error: No code quality report path found. Make sure you are inside GitLab CI with a codequality artifact defined."},{"fix":"Ensure stylelint-formatter-gitlab is installed as a devDependency. Use node_modules/.bin/stylelint or --custom-formatter=./node_modules/stylelint-formatter-gitlab","cause":"The formatter is not installed or not in node_modules when using npx with --custom-formatter.","error":"Cannot find module 'stylelint-formatter-gitlab'"},{"fix":"Reinstall the package: npm install stylelint-formatter-gitlab","cause":"The formatter module does not export a proper formatter function (e.g., using require instead of import) or is malformed.","error":"Error: Invalid formatter 'stylelint-formatter-gitlab'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://gitlab.com/leon0399/stylelint-formatter-gitlab#readme","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"stylelint-formatter-gitlab","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}