Registry / testing / visualstudio-tslint-formatter

visualstudio-tslint-formatter

JSON →
library0.8.0jsnpmunverified

A custom formatter for TSLint that outputs lint results in a format compatible with the Visual Studio Error List window (v0.8.0). This package requires TSLint v5 or higher and is designed for developers using Visual Studio who want integrated linting feedback. It is a lightweight adapter, with no active development since 2019. The formatter must be used via TSLint's --formatters-dir option. Note that TSLint itself is deprecated in favor of ESLint, and this package is effectively unmaintained.

npm install visualstudio-tslint-formatter
INSTALL
IMPORT
SIG · VISUALSTUDIO-TSLIN
V
visualstudio-tslint-formatter
testingjavascriptv0.8.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.

VisualStudioFormatter
const formatter = require('visualstudio-tslint-formatter');
import formatter from 'visualstudio-tslint-formatter';
The package only exports a CommonJS module; ESM import will fail.

Demonstrates how to install and use the formatter with TSLint CLI, resolving the directory path programmatically.

// Install: npm install --save-dev visualstudio-tslint-formatter tslint // Use with TSLint CLI: // tslint --formatters-dir node_modules/visualstudio-tslint-formatter --format visualstudio-tslint-formatter src/**/*.ts const path = require('path'); const formatterPath = path.dirname(require.resolve('visualstudio-tslint-formatter')); console.log(`Formatters dir: ${formatterPath}`); // Then run: tslint --formatters-dir "${formatterPath}" --format visualstudio-tslint-formatter input.ts
Debug
Known issues
deprecatedTSLint has been deprecated in favor of ESLint. Use eslint-plugin-typescript instead.
fix
Migrate to ESLint with @typescript-eslint/parser.
affects: all
breakingNo breaking changes known, but peer dependency requires tslint ^5.0.0.
fix
Ensure tslint is installed at version 5.x.
affects: >=0.0.0
gotchaThe formatter must be used with --formatters-dir; providing the module name directly doesn't work.
fix
Always specify --formatters-dir path/to/node_modules/visualstudio-tslint-formatter
affects: all
Errors
Common errors & fixes
Cannot find module 'visualstudio-tslint-formatter'
Missing --formatters-dir flag or incorrect path.
fix
Use: tslint --formatters-dir node_modules/visualstudio-tslint-formatter --format visualstudio-tslint-formatter
Error: Unsupported formatter visualstudio-tslint-formatter
TSLint cannot locate the formatter because the --formatters-dir is not set.
fix
Add --formatters-dir <path-to-node_modules/visualstudio-tslint-formatter>
Upgrade
Version history
0.8.0latest on npm
Audit
Dependencies
tslintrequiredpeer dependency - the formatter is used by TSLint
Agent activity
6 hits · last 30 days
node
6
Resources