<commit_before>gulp-tslint
=========

Note: This is work in progress.

TypeScript linter plugin for Gulp.


First install gulp-tslint
```shell
npm install --save-dev gulp-tslint
```


Usage:
```javascript
var tslint = require('gulp-tslint');

gulp.task('tslint', function(){
      gulp.src('source.ts')
        .pipe(tslint())
        .pipe(tslint.report('verbose'));
});
```

tslint.json is attempted to be read from near the input file.

The output (stringified JSON) is added to file.tslint.output.
You can output the errors by using reporters.
There are four default reporters:
* 'json' prints stringified JSON to console.log.
* 'prose' prints short human-readable failures to console.log.
* 'verbose' prints longer human-readable failures to console.log.
* 'full' is like verbose, but displays full path to the file
Reporters are executed only if there is at least one failure.

You can use your own reporter by supplying a function.
```javascript
/* Output is in the following form:
 * [{
 *   "name": "invalid.ts",
 *   "failure": "missing whitespace",
 *   // Lines and characters start from 0
 *   "startPosition": {"position": 8, "line": 0, "character": 8},
 *   "endPosition": {"position": 9, "line": 0, "character": 9},
 *   "ruleName": "one-line"
 * }]
 */
var testReporter = function (output, file) {
    // file is a reference to the vinyl File object
    console.log("Found " + output.length + " errors in " + file.path);
};

gulp.task('invalid-custom', function(){
      gulp.src('invalid.ts')
        .pipe(tslint())
        .pipe(tslint.report(testReporter));
});
```

tslint.json can be supplied as a parameter by setting the configuration property.
```javascript
gulp.task('tslint-json', function(){
      gulp.src('invalid.ts')<commit_msg>Style fix<commit_after>gulp-tslint
=========

Note: This is work in progress.

TypeScript linter plugin for Gulp.


First install gulp-tslint
```shell
npm install --save-dev gulp-tslint
```


Usage:
```javascript
var tslint = require('gulp-tslint');

gulp.task('tslint', function(){
      gulp.src('source.ts')
        .pipe(tslint())
        .pipe(tslint.report('verbose'));
});
```

tslint.json is attempted to be read from near the input file.

The output (stringified JSON) is added to file.tslint.output.
You can output the errors by using reporters.
There are four default reporters:
* 'json' prints stringified JSON to console.log.
* 'prose' prints short human-readable failures to console.log.
* 'verbose' prints longer human-readable failures to console.log.
* 'full' is like verbose, but displays full path to the file

Reporters are executed only if there is at least one failure.

You can use your own reporter by supplying a function.
```javascript
/* Output is in the following form:
 * [{
 *   "name": "invalid.ts",
 *   "failure": "missing whitespace",
 *   // Lines and characters start from 0
 *   "startPosition": {"position": 8, "line": 0, "character": 8},
 *   "endPosition": {"position": 9, "line": 0, "character": 9},
 *   "ruleName": "one-line"
 * }]
 */
var testReporter = function (output, file) {
    // file is a reference to the vinyl File object
    console.log("Found " + output.length + " errors in " + file.path);
};

gulp.task('invalid-custom', function(){
      gulp.src('invalid.ts')
        .pipe(tslint())
        .pipe(tslint.report(testReporter));
});
```

tslint.json can be supplied as a parameter by setting the configuration property.
```javascript
gulp.task('tslint-json', function(){
      gulp.src('invalid.ts')
{'fraction_non_alphanumeric': 0.14435919295254335, 'fraction_numerical': 0.003978402955385053, 'mean_word_length': 3.7761194029850746, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1132327', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1054, 'n_words': 376}