ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
831 stars 129 forks source link

fix(fullReporter): Fix off-by-one display issue #620

Closed elliot-nelson closed 4 years ago

elliot-nelson commented 5 years ago

SUMMARY

Tweak the fullReporter slightly to display the correct line and column highlighting.

TESTS

No tests included; I don't see an easy way to provide a test for a reporter given the current approach, but let me know if I'm missing something.

TEST CASE

Using this example build, here are before and after screenshots of the output...

// gulpfile.js
module.exports.default = () => {
    const ts = typescript.createProject('tsconfig.json', typescript.reporter.fullReporter());
    return gulp.src('src/ts/example.ts')
        .pipe(ts(typescript.reporter.fullReporter())).js
        .pipe(gulp.dest('dist'));
};
// src/ts/example.ts
export function example() {
    console.log(Math.squeak());
}

BEFORE SCREENSHOT

Screen Shot 2019-07-01 at 7 31 53 AM

AFTER SCREENSHOT

Screen Shot 2019-07-01 at 7 29 51 AM
ivogabe commented 4 years ago

Thanks for your PR Elliot! Sorry for the delay