Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
TSLint formatter that displays absolute paths with row/column on one line.
JavaScript
branch: master
Failed to load latest commit information.
cookbooks @ 1e6fb52 added test
test added support for rule-names in error
.gitignore added test
.gitmodules added test
.jshintrc added test
.npmignore initial version
.travis.yml initial version
Gruntfile.js added support for rule-names in error
LICENSE-MIT initial version
README.md
Vagrantfile added test
index.js added support for rule-names in error
package.json added support for rule-names in error

README.md

tslint-path-formatter

Build Status Dependency Status NPM version

TSLint formatter that displays absolute error path with row/column on one line.

A console formatter similar to the default output except the report displays absolute file paths with the row/column appended in a parsable format. The TypeScript equivalent of jshint-path-reporter.

This allows convenient use of TSLint from within tools that apply a filter RegExp to console views to turn error lines into clickable links to instantly navigate to the error location.

WebStorm

This reporter is tested and actively used in WebStorm with grunt-tslint. For maximum effect have a output filter configured in its edit-tool-dialog of the tool you run, something like:

$FILE_PATH$[ \t]*[:;,\[\(\{<]$LINE$(?:[:;,\.]$COLUMN$)?.*

Usage

Install from NPM

 $ npm install tslint-path-formatter

Then pass name of the module (or anything acceptable to require.resolve()) as the reporter option.

grunt-tslint

grunt.initConfig({
    //..
    tslint: {
        options: {
            configuration: grunt.file.readJSON("tslint.json"),
            formatter: 'tslint-path-formatter'
        }),
        source: {
            //..
        }
    }
});

Options

Globally disable ANSI colouring

For low-tech displays and pure text.

require('tslint-path-formatter').color(false);

Example output

Looks very similar to jshint-path-reporter:

WebStorm (with link filter and darcula theme): webstorm darcula

History

Build

Install development dependencies in your git checkout:

$ npm install

You need the global grunt command:

$ npm install grunt-cli -g

Build and run tests:

$ grunt

See the Gruntfile for additional commands.

License

Copyright (c) 2013 Bart van der Schoor

Licensed under the MIT license.

Bitdeli Badge

Something went wrong with that request. Please try again.