Registry / devops / tslint-unix-formatter

tslint-unix-formatter

JSON →
library0.2.0jsnpmunverified

A formatter for TSLint that outputs errors in Unix-style (similar to gjslint's --unix_mode), useful for Emacs integration. Current version 0.2.0, no recent updates. Provides a simple custom formatter for TSLint. Works with TSLint >=3.2.2 and TypeScript >=1.7.5.

npm install tslint-unix-formatter
INSTALL
IMPORT
SIG · TSLINT-UNIX-FORMAT
T
tslint-unix-formatter
devopsjavascriptv0.2.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 = new (require('tslint-unix-formatter'))();
import { UnixFormatter } from 'tslint-unix-formatter';
The package does not export a class; you must require the module directly which returns a constructor that implements TSLint's Formatter interface.

Shows how to configure tslint to use the unix formatter via CLI and programmatic usage.

// Add to tslint.json: // { "formattersDir": "./node_modules/tslint-unix-formatter/lib", "formatter": "unix" } // Then run: tslint -t unix -s ./node_modules/tslint-unix-formatter/lib/ src/**/*.ts // Or programmatically: const { run } = require('tslint'); const { Configuration } = require('tslint'); const opts = { formatter: 'unix', formattersDirectory: './node_modules/tslint-unix-formatter/lib', files: ['src/**/*.ts'], config: Configuration.findConfiguration(null, '.').results }; run(opts, console.log);
Debug
Known issues
deprecatedTSLint is deprecated in favor of ESLint with @typescript-eslint. This formatter only works with TSLint.
fix
Migrate to ESLint with @typescript-eslint and use ESLint formatters like 'unix'.
affects: *
Errors
Common errors & fixes
TypeError: formatter is not a constructor
Incorrect import or usage of the formatter module.
fix
Ensure you use `require('tslint-unix-formatter')` directly without destructuring and pass the constructor to TSLint's formatter loader.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
tslintrequiredpeer dependency required at runtime to provide the formatter interface
Agent activity
4 hits · last 30 days
node
4
Resources
tslint-unix-formatter — npm install tslint-unix-formatter · libregistry