Registry / testing / tslint-junit-formatter

tslint-junit-formatter

JSON →
library5.1.0jsnpmunverified

Tslint-junit-formatter is a custom formatter for TSLint that outputs lint results in JUnit XML format, commonly used for CI/CD integration (e.g., Jenkins). Current stable version is 5.1.0. The package requires a peer dependency on tslint ^5.0.0. It provides a simple way to generate JUnit-compatible test reports from TSLint results. Unlike built-in formatters, this one outputs XML that can be consumed by JUnit report parsers. The project is in maintenance mode, as TSLint is deprecated in favor of ESLint.

npm install tslint-junit-formatter
INSTALL
IMPORT
SIG · TSLINT-JUNIT-FORMA
T
tslint-junit-formatter
testingjavascriptv5.1.0
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'
const Formatter = require('tslint-junit-formatter').Formatter
The formatter is loaded by TSLint via the --formatters-dir and --format options, not imported directly.

Runs TSLint on TypeScript files in src/ and outputs JUnit XML report to tslint-results.xml.

npx tslint --formatters-dir node_modules/tslint-junit-formatter/formatters --format junit src/**/*.ts > tslint-results.xml
Debug
Known issues
deprecatedTSLint is deprecated in favor of ESLint with typescript-eslint plugin. This package is unlikely to receive updates.
fix
Migrate to ESLint and use a JUnit formatter for ESLint (e.g., eslint-plugin-junit).
affects: >=0.0.0
gotchaThe formatter file is located in a 'formatters' subdirectory inside the package. Running from the wrong directory may cause 'Cannot find formatter' error.
fix
Use the full path: --formatters-dir node_modules/tslint-junit-formatter/formatters
affects: >=0.0.0
gotchaFormatters-dir must point to the directory containing the formatter JS file, not the package root.
fix
Ensure the path ends with '/formatters' (or the correct subdirectory).
affects: >=0.0.0
Errors
Common errors & fixes
Could not find formatter 'junit'
The --formatters-dir path is missing or incorrect.
fix
Set --formatters-dir to the directory that contains the formatter file (e.g., node_modules/tslint-junit-formatter/formatters).
Cannot find module 'tslint'
tslint is not installed as a peer dependency.
fix
Install tslint: npm install tslint --save-dev
Upgrade
Version history
5.1.0latest on npm
Audit
Dependencies
tslintrequiredpeer dependency required to provide TSLint types and API
Agent activity
8 hits · last 30 days
node
8
Resources
tslint-junit-formatter — npm install tslint-junit-formatter · libregistry