Registry / devops / tslint-teamcity-reporter

tslint-teamcity-reporter

JSON →
library3.2.2jsnpmunverified

A TSLint formatter/reporter for TeamCity CI that outputs lint results as TeamCity service messages, grouping errors by file as test suites. Current version 3.2.2 (v3 is a complete rewrite with breaking changes). Maintained as stable, with low release frequency. Differentiates from standard TSLint formatters by producing TeamCity-native output (test suites for files, inspection reports) and supporting configuration via CLI arguments, package.json, or environment variables.

npm install tslint-teamcity-reporter
INSTALL
IMPORT
SIG · TSLINT-TEAMCITY-RE
T
tslint-teamcity-reporter
devopsjavascriptv3.2.2
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.

Formatter
import { Formatter } from 'tslint-teamcity-reporter'
const Formatter = require('tslint-teamcity-reporter')
Package ships TypeScript types. Use named import for ESM; CommonJS require may not work in ESM contexts.
formatter
const formatter = require('tslint-teamcity-reporter')
import formatter from 'tslint-teamcity-reporter'
Default export is the formatter function. For CommonJS, use require. For ESM, use named import 'Formatter'.
FormatterOptions
import type { FormatterOptions } from 'tslint-teamcity-reporter'
import { FormatterOptions } from 'tslint-teamcity-reporter'
TypeScript users should import the type for option objects to leverage type checking.

Shows how to use the Formatter class to convert TSLint failures into TeamCity service messages with options for report name and reporter type.

import { Formatter } from 'tslint-teamcity-reporter'; const formatter = new Formatter(); const failures = [ { fileName: 'src/app.ts', ruleName: 'no-unused-variable', startPosition: { line: 1, character: 1 }, endPosition: { line: 1, character: 10 }, failure: 'Unused variable: "x"', ruleSeverity: 'error' } ]; const output = formatter.format(failures, { reporter: 'errors', reportName: 'TSLint Violations', errorStatisticsName: 'Error count', warningStatisticsName: 'Warning count' }); console.log(output); // Outputs TeamCity service messages
Debug
Known issues
breakingv3.0.0 completely rewrites the formatter; output format changed from individual errors to file-grouped test suites.
fix
Update TeamCity metric baselines as failed test count will drop. See README migration notes.
affects: >=3.0.0
breakingCLI formatter path changed from `-t tslint-teamcity-reporter` to `-t ./node_modules/tslint-teamcity-reporter/index.js`.
fix
Adjust CLI invocation to use full path: `tslint files/**/*.ts -t ./node_modules/tslint-teamcity-reporter/index.js`.
affects: >=3.0.0
gotchaWhen using gulp-tslint, a falsy `formattersDirectory` causes a runtime error in TSLint.
fix
Set `formattersDirectory` to a truthy string, e.g. `'anything-but-falsy'`, to avoid null being passed.
affects: *
gotchaPackage requires TSLint to be installed; no runtime peer dependency listed.
fix
Ensure tslint is installed in your project as a dependency.
affects: *
gotchaConfiguration priority may be confusing: CLI args override package.json, which overrides env vars.
fix
Use only one configuration method to avoid unintended overrides.
affects: *
Errors
Common errors & fixes
Error: Invalid formatter. Does not implement IFormatter.
Using wrong import or path for the formatter in CLI or code.
fix
Use correct path: `-t ./node_modules/tslint-teamcity-reporter/index.js` or import `{ Formatter }` from the package.
Cannot find module 'tslint-teamcity-reporter'
Package not installed or not in node_modules.
fix
Run `npm install -D tslint-teamcity-reporter` or `yarn add -D tslint-teamcity-reporter`.
TypeError: formatter.format is not a function
Using default import instead of named import for Formatter in ESM.
fix
Use `import { Formatter } from 'tslint-teamcity-reporter'` and instantiate with `new Formatter()`.
TypeError: Cannot read properties of undefined (reading 'format')
Using gulp-tslint with falsy formattersDirectory causing null argument.
fix
Set formattersDirectory to a non-falsy value like `'.'` or `'anything-but-falsy'`.
Upgrade
Version history
3.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
tslint-teamcity-reporter — npm install tslint-teamcity-reporter · libregistry