{"id":19652,"library":"eslint-formatter-teamcity","title":"eslint-formatter-teamcity","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"git://github.com/andreogle/eslint-formatter-teamcity","tags":["javascript","eslint","teamcity","formatter","linting","typescript"],"install":[{"cmd":"npm install eslint-formatter-teamcity","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-formatter-teamcity","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-formatter-teamcity","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export is a function. Both ESM and CJS supported; CJS require works but ESM recommended for TypeScript resolution.","wrong":"const eslintTeamcity = require('eslint-formatter-teamcity')","symbol":"eslintTeamcity (default export)","correct":"import eslintTeamcity from 'eslint-formatter-teamcity'"},{"note":"TypeScript types available since v2.0.1. Use `import type` to avoid bundling.","wrong":"import { FormatterOptions } from 'eslint-formatter-teamcity' (value import, causes runtime error)","symbol":"TypeScript type: FormatterOptions","correct":"import type { FormatterOptions } from 'eslint-formatter-teamcity'"},{"note":"ESLint resolves the formatter by the short name 'teamcity' (without namespace) when installed as `eslint-formatter-*`.","wrong":"eslint --format eslint-formatter-teamcity myfile.js","symbol":"CLI usage","correct":"eslint --format teamcity myfile.js"},{"note":"When running directly, you must provide a path to an ESLint JSON report file as an argument.","wrong":"node ./node_modules/eslint-formatter-teamcity/index.js","symbol":"Direct Node.js script","correct":"node ./node_modules/eslint-formatter-teamcity/index.js result.json"}],"quickstart":{"code":"# Install as dev dependency\nnpm install eslint-formatter-teamcity --save-dev\n\n# Create an ESLint config file (.eslintrc.json or similar)\necho '{}' > .eslintrc.json\n\n# Create a test file with a lint violation (e.g., unused variable)\necho 'let x = 1;' > test.js\n\n# Run ESLint with the TeamCity formatter (short name, no namespace)\neslint --format teamcity test.js\n\n# Expected output:\n# ##teamcity[testSuiteStarted name='ESLint Violations']\n# ##teamcity[testStarted name='test.js: let is not defined']\n# ##teamcity[testFailed name='test.js: let is not defined' message='Error: ESLint - let is not defined' details='...']\n# ##teamcity[testSuiteFinished name='ESLint Violations']","lang":"javascript","description":"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."},"warnings":[{"fix":"Add `fs-extra` to your own `package.json` if you were relying on it transitively.","message":"v2.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.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Update your `package.json` to depend on `eslint-formatter-teamcity` and change all imports.","message":"The old package name `eslint-teamcity` is deprecated. Use `eslint-formatter-teamcity` instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Upgrade to v2.0.1 or later for proper type resolution.","message":"TypeScript types were missing before v2.0.1. Upgrading from v2.0.0 to v2.0.1 may cause TypeScript errors if you had workarounds.","severity":"gotcha","affected_versions":"<2.0.1"},{"fix":"Use `eslint --format teamcity` (without the `eslint-formatter-` prefix).","message":"CLI formatter name is `teamcity`, not `eslint-formatter-teamcity`. Running `eslint --format eslint-formatter-teamcity` will fail.","severity":"gotcha","affected_versions":">=0"},{"fix":"Call `eslintTeamcity(eslintOutput)` where `eslintOutput` is the full results array or object from ESLint.","message":"When using the formatter programmatically, you must pass the ESLint results object (as returned by `ESLint.lintFiles()` or `CLIEngine.executeOnFiles()`), not the raw file contents.","severity":"gotcha","affected_versions":">=0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-formatter-teamcity --save-dev` and ensure you are running the command from the project root.","cause":"The package is not installed or not in the current working directory's node_modules.","error":"Error: Cannot find module 'eslint-formatter-teamcity'"},{"fix":"Use default import: `import eslintTeamcity from 'eslint-formatter-teamcity'` (no curly braces).","cause":"Incorrect import style; likely used named import when package has a default export only.","error":"TypeError: eslintTeamcity is not a function"},{"fix":"Install as devDependency: `npm install eslint-formatter-teamcity --save-dev` and run ESLint from the project root.","cause":"The formatter is not installed or ESLint cannot find it (e.g., running from wrong directory).","error":"ESLint: Unknown formatter 'teamcity'"},{"fix":"Upgrade to v2.0.1 or later, or create a custom declaration file (`declare module 'eslint-formatter-teamcity'`).","cause":"Package version <2.0.1 did not ship TypeScript types.","error":"Type error: Could not find a declaration file for module 'eslint-formatter-teamcity'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}