{"id":42039,"library":"stylelint-teamcity-formatter","title":"stylelint-teamcity-formatter","description":"Formats Stylelint (up to v16+) output for TeamCity CI, reporting lint issues as Inspections or Tests via service messages, with optional build statistics. Version 2.2.1 supports Stylelint's --custom-formatter CLI option (no longer requires --formatter). Differentiators: native TeamCity Inspections vs Tests mode, zero-config setup, counters for error/warning statistics, and compatibility with both CJS and ESM. Maintained as of 2025.","status":"active","version":"2.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/tihonove/stylelint-teamcity-formatter","tags":["javascript","lint","css lint","style lint","scss lint","less lint","stylelint","stylelint-formatter"],"install":[{"cmd":"npm install stylelint-teamcity-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add stylelint-teamcity-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add stylelint-teamcity-formatter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the formatter receives Stylelint results","package":"stylelint","optional":false}],"imports":[{"note":"Package uses default export; ESM import works, but for Stylelint's --custom-formatter you pass the module path directly, not import it.","wrong":"const formatter = require('stylelint-teamcity-formatter')","symbol":"default","correct":"import formatter from 'stylelint-teamcity-formatter'"},{"note":"CommonJS require works, but Stylelint expects a function; --custom-formatter path resolves the module.","wrong":"import formatter from 'stylelint-teamcity-formatter'","symbol":"formatter as default (CommonJS require)","correct":"const formatter = require('stylelint-teamcity-formatter');"},{"note":"No named export 'config'; configuration is via package.json field 'stylelint-teamcity-formatter' or environment variable.","wrong":"import { config } from 'stylelint-teamcity-formatter'","symbol":"config","correct":"import config from 'stylelint-teamcity-formatter' // not used directly\n// Instead configure via package.json or env var"}],"quickstart":{"code":"// Install:\n// npm install stylelint-teamcity-formatter --save-dev\n\n// Use with stylelint CLI (Stylelint >= 16):\n/** stylelint \"src/**/*.css\" --custom-formatter stylelint-teamcity-formatter */\n\n// Or configure output mode via package.json:\n{\n  \"stylelint-teamcity-formatter\": {\n    \"output\": \"tests\",\n    \"statistics\": true\n  }\n}\n\n// Example TeamCity build step:\n// npm run lint","lang":"javascript","description":"Sets up the TeamCity formatter with optional tests output mode and statistics."},"warnings":[{"fix":"Use --custom-formatter stylelint-teamcity-formatter instead of --formatter.","message":"Stylelint 16 changed --formatter to --custom-formatter; legacy --formatter broken.","severity":"breaking","affected_versions":">=16.0.0"},{"fix":"Use package name directly: --custom-formatter stylelint-teamcity-formatter","message":"Using --custom-formatter with a relative path like node_modules/stylelint-teamcity-formatter is deprecated in Stylelint >=16.","severity":"deprecated","affected_versions":">=16.0.0"},{"fix":"Use exact spelling: STYLELINT_TEAMCITY_FORMATTER_OUTPUT (no 'A' after M).","message":"Environment variable STYLELINT_TEAMCITY_FORMATTER_OUTPUT is misspelled; note 'TEAMCITY' not 'TEAMCITY'.","severity":"gotcha","affected_versions":"*"},{"fix":"Correct key: \"stylelint-teamcity-formatter\": { ... }","message":"Configuration in package.json must be under key 'stylelint-teamcity-formatter' (with hyphens) not camelCase.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure stylelint rules use severity 'warning' or 'error' for counting.","message":"Statistics only count warnings and errors; excludes other severity levels like 'info' (if any).","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'2.2.1':29 '2025':67 'build':26 'ci':13 'cjs':61 'cli':36 'compat':58 'config':51 'counter':53 'css':70 'custom':34 'custom-formatt':33 'differenti':42 'error/warning':55 'esm':63 'format':5 'formatt':4,35,41,81 'inspect':18,45 'issu':16 'javascript':68 'less':76 'lint':15,69,71,73,75,77 'longer':39 'maintain':64 'messag':23 'mode':48 'nativ':43 'option':25,37 'output':10 'report':14 'requir':40 'scss':74 'servic':22 'setup':52 'statist':27,56 'style':72 'stylelint':2,6,31,78,80 'stylelint-formatt':79 'stylelint-teamcity-formatt':1 'support':30 'teamciti':3,12,44 'test':20,47 'v16':9 'version':28 'via':21 'vs':46 'zero':50 'zero-config':49","created_at":"2026-06-04T18:55:19.520073+00:00","updated_at":"2026-06-04T18:55:19.520073+00:00","problems":[{"fix":"Run: npm install stylelint-teamcity-formatter --save-dev","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'stylelint-teamcity-formatter'"},{"fix":"For Stylelint 15 and older, use --formatter path: --formatter node_modules/stylelint-teamcity-formatter","cause":"Using an older Stylelint version (<16) that doesn't support --custom-formatter.","error":"Unknown argument: --custom-formatter"},{"fix":"Ensure --custom-formatter points to the package entry, not a different file.","cause":"Using a re-export wrapper instead of the default export directly.","error":"Expected formatter to be a function, got object"}],"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://github.com/tihonove/stylelint-teamcity-formatter#readme","github":"https://github.com/tihonove/stylelint-teamcity-formatter","docs":null,"changelog":null,"pypi":null,"npm":"stylelint-teamcity-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"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}}