Registry / devops / eslint-formatter-teamcity

eslint-formatter-teamcity

JSON →
library2.0.1jsnpmunverified

ESLint formatter that outputs violations in TeamCity build error format. Current version 2.0.1 (released 2023-08-01). Zero runtime dependencies since v2.0.0 (uses only Node.js built-ins). Supports ESM and CommonJS. Ships TypeScript types. Configurable via function argument, package.json, or environment variables. Tested with TeamCity 9.1.x/10.0.x/2017+ and ESLint 1+. Key differentiator: designed specifically for TeamCity CI integration with both errors and inspections reporters.

npm install eslint-formatter-teamcity
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-T
E
eslint-formatter-teamcity
devopsjavascriptv2.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

eslintTeamcity (default export)
import eslintTeamcity from 'eslint-formatter-teamcity'
const eslintTeamcity = require('eslint-formatter-teamcity')
Default export is a function. Both ESM and CJS supported; CJS require works but ESM recommended for TypeScript resolution.
TypeScript type: FormatterOptions
import type { FormatterOptions } from 'eslint-formatter-teamcity'
import { FormatterOptions } from 'eslint-formatter-teamcity' (value import, causes runtime error)
TypeScript types available since v2.0.1. Use `import type` to avoid bundling.
CLI usage
eslint --format teamcity myfile.js
eslint --format eslint-formatter-teamcity myfile.js
ESLint resolves the formatter by the short name 'teamcity' (without namespace) when installed as `eslint-formatter-*`.
Direct Node.js script
node ./node_modules/eslint-formatter-teamcity/index.js result.json
node ./node_modules/eslint-formatter-teamcity/index.js
When running directly, you must provide a path to an ESLint JSON report file as an argument.

Install the package, create a minimal ESLint config and a file with a lint violation, then run ESLint with the TeamCity formatter to see service messages.

# Install as dev dependency npm install eslint-formatter-teamcity --save-dev # Create an ESLint config file (.eslintrc.json or similar) echo '{}' > .eslintrc.json # Create a test file with a lint violation (e.g., unused variable) echo 'let x = 1;' > test.js # Run ESLint with the TeamCity formatter (short name, no namespace) eslint --format teamcity test.js # Expected output: # ##teamcity[testSuiteStarted name='ESLint Violations'] # ##teamcity[testStarted name='test.js: let is not defined'] # ##teamcity[testFailed name='test.js: let is not defined' message='Error: ESLint - let is not defined' details='...'] # ##teamcity[testSuiteFinished name='ESLint Violations']
Debug
Known issues
breakingv2.0.0 removed the fs-extra dependency. If your project depends on fs-extra being hoisted by eslint-formatter-teamcity, you must add it as a direct dependency.
fix
Add `fs-extra` to your own `package.json` if you were relying on it transitively.
affects: >=2.0.0
deprecatedThe old package name `eslint-teamcity` is deprecated. Use `eslint-formatter-teamcity` instead.
fix
Update your `package.json` to depend on `eslint-formatter-teamcity` and change all imports.
affects: >=1.0.0
gotchaTypeScript types were missing before v2.0.1. Upgrading from v2.0.0 to v2.0.1 may cause TypeScript errors if you had workarounds.
fix
Upgrade to v2.0.1 or later for proper type resolution.
affects: <2.0.1
gotchaCLI formatter name is `teamcity`, not `eslint-formatter-teamcity`. Running `eslint --format eslint-formatter-teamcity` will fail.
fix
Use `eslint --format teamcity` (without the `eslint-formatter-` prefix).
affects: >=0
gotchaWhen using the formatter programmatically, you must pass the ESLint results object (as returned by `ESLint.lintFiles()` or `CLIEngine.executeOnFiles()`), not the raw file contents.
fix
Call `eslintTeamcity(eslintOutput)` where `eslintOutput` is the full results array or object from ESLint.
affects: >=0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-teamcity'
The package is not installed or not in the current working directory's node_modules.
fix
Run `npm install eslint-formatter-teamcity --save-dev` and ensure you are running the command from the project root.
TypeError: eslintTeamcity is not a function
Incorrect import style; likely used named import when package has a default export only.
fix
Use default import: `import eslintTeamcity from 'eslint-formatter-teamcity'` (no curly braces).
ESLint: Unknown formatter 'teamcity'
The formatter is not installed or ESLint cannot find it (e.g., running from wrong directory).
fix
Install as devDependency: `npm install eslint-formatter-teamcity --save-dev` and run ESLint from the project root.
Type error: Could not find a declaration file for module 'eslint-formatter-teamcity'
Package version <2.0.1 did not ship TypeScript types.
fix
Upgrade to v2.0.1 or later, or create a custom declaration file (`declare module 'eslint-formatter-teamcity'`).
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
eslint-formatter-teamcity — npm install eslint-formatter-teamcity · libregistry