Registry / testing / stylelint-teamcity-formatter

stylelint-teamcity-formatter

JSON →
library2.2.1jsnpmunverified

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.

npm install stylelint-teamcity-formatter
INSTALL
IMPORT
SIG · STYLELINT-TEAMCITY
S
stylelint-teamcity-formatter
testingjavascriptv2.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import formatter from 'stylelint-teamcity-formatter'
const formatter = require('stylelint-teamcity-formatter')
Package uses default export; ESM import works, but for Stylelint's --custom-formatter you pass the module path directly, not import it.
formatter as default (CommonJS require)
const formatter = require('stylelint-teamcity-formatter');
import formatter from 'stylelint-teamcity-formatter'
CommonJS require works, but Stylelint expects a function; --custom-formatter path resolves the module.
config
import config from 'stylelint-teamcity-formatter' // not used directly // Instead configure via package.json or env var
import { config } from 'stylelint-teamcity-formatter'
No named export 'config'; configuration is via package.json field 'stylelint-teamcity-formatter' or environment variable.

Sets up the TeamCity formatter with optional tests output mode and statistics.

// Install: // npm install stylelint-teamcity-formatter --save-dev // Use with stylelint CLI (Stylelint >= 16): /** stylelint "src/**/*.css" --custom-formatter stylelint-teamcity-formatter */ // Or configure output mode via package.json: { "stylelint-teamcity-formatter": { "output": "tests", "statistics": true } } // Example TeamCity build step: // npm run lint
Debug
Known issues
breakingStylelint 16 changed --formatter to --custom-formatter; legacy --formatter broken.
fix
Use --custom-formatter stylelint-teamcity-formatter instead of --formatter.
affects: >=16.0.0
deprecatedUsing --custom-formatter with a relative path like node_modules/stylelint-teamcity-formatter is deprecated in Stylelint >=16.
fix
Use package name directly: --custom-formatter stylelint-teamcity-formatter
affects: >=16.0.0
gotchaEnvironment variable STYLELINT_TEAMCITY_FORMATTER_OUTPUT is misspelled; note 'TEAMCITY' not 'TEAMCITY'.
fix
Use exact spelling: STYLELINT_TEAMCITY_FORMATTER_OUTPUT (no 'A' after M).
affects: *
gotchaConfiguration in package.json must be under key 'stylelint-teamcity-formatter' (with hyphens) not camelCase.
fix
Correct key: "stylelint-teamcity-formatter": { ... }
affects: >=2.0.0
gotchaStatistics only count warnings and errors; excludes other severity levels like 'info' (if any).
fix
Ensure stylelint rules use severity 'warning' or 'error' for counting.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'stylelint-teamcity-formatter'
Package not installed or not in node_modules.
fix
Run: npm install stylelint-teamcity-formatter --save-dev
Unknown argument: --custom-formatter
Using an older Stylelint version (<16) that doesn't support --custom-formatter.
fix
For Stylelint 15 and older, use --formatter path: --formatter node_modules/stylelint-teamcity-formatter
Expected formatter to be a function, got object
Using a re-export wrapper instead of the default export directly.
fix
Ensure --custom-formatter points to the package entry, not a different file.
Upgrade
Version history
2.2.1latest on npm
Audit
Dependencies
stylelintrequiredpeer dependency; the formatter receives Stylelint results
Agent activity
4 hits · last 30 days
node
4
Resources
stylelint-teamcity-formatter — npm install stylelint-teamcity-formatter · libregistry