Registry / devops / tslint-formatter-vscode

tslint-formatter-vscode

JSON →
library2.1.0jsnpmunverified

A TSLint formatter that outputs errors and warnings in a file:line:col format suitable for Visual Studio Code's problem matcher. Version 2.1.0 is the final release of a package that has been effectively superseded by ESLint/tslint-deprecation. The package has a low maintenance cadence and is tied to legacy TSLint peer dependencies (^4.2.0 or ^5.2.0). Its key differentiator is producing VSCode-compatible output with severity labels, but it is now considered obsolete due to the TSLint deprecation.

npm install tslint-formatter-vscode
INSTALL
IMPORT
SIG · TSLINT-FORMATTER-V
T
tslint-formatter-vscode
devopsjavascriptv2.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.

default export
import * as formatter from 'tslint-formatter-vscode'
const formatter = require('tslint-formatter-vscode');
Package does not support CommonJS require via default export; use namespace import for all exports.
Formatter constructor
import { Formatter } from 'tslint-formatter-vscode';
The Formatter class is exported as a named export.
ILintResult type
import type { ILintResult } from 'tslint-formatter-vscode';
ILintResult is a TypeScript interface; use type import with `import type` in TypeScript 3.8+.

Shows how to use the formatter programmatically by passing the formatter name to TSLint's run function.

import { run } from 'tslint'; import { Formatter } from 'tslint-formatter-vscode'; const options = { files: ['./src/**/*.ts'], formatter: 'tslint-formatter-vscode', formattersDirectory: './node_modules/tslint-formatter-vscode' }; run(options, (status: number) => { console.log(`Linting complete with status ${status}`); });
Debug
Known issues
deprecatedTSLint is deprecated. This formatter is only useful if you still use TSLint. Migrate to ESLint.
fix
Migrate to ESLint and use eslint-formatter-vscode or eslint-formatter-unix.
affects: >=1.0.0
gotchaThe package expects tslint as a peer dependency. Ensure you have tslint installed, otherwise you'll get a missing peer dep warning.
fix
Install tslint: npm install tslint --save-dev
affects: >=1.0.0
breakingVersion 2.0.0 changed the output format from an older style to include severity labels ('warning' and 'error'). Scripts parsing the output will break if not updated.
fix
Update any custom parsers to expect the new format: '$file ($line,$col): warning TSLINT: $message ($ruleName)'.
affects: >=2.0.0 <3.0.0
Errors
Common errors & fixes
Cannot find module 'tslint-formatter-vscode'
Missing package installation or incorrect path
fix
npm install tslint-formatter-vscode --save-dev
No formatter found for 'tslint-formatter-vscode'
The formattersDirectory option is not set correctly, or the package is not installed in node_modules
fix
Ensure formattersDirectory points to the directory containing the package (e.g., './node_modules/tslint-formatter-vscode')
TypeError: The formatter function did not return a string
The formatter function must return a string, but older versions of tslint may call it incorrectly
fix
Update tslint to version ^5.2.0 or later
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
tslintrequiredpeer dependency; provides the TSLint engine that calls the formatter
Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources
tslint-formatter-vscode — npm install tslint-formatter-vscode · libregistry