Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Report line and column numbers of the error as (line,column) instead of [line, column] #3603

Closed
afroozeh opened this issue Dec 22, 2017 · 3 comments

Comments

@afroozeh
Copy link

Bug Report

  • TSLint version: 5.8.0
  • TypeScript version: 2.6.1
  • Running TSLint via: CLI

Actual behavior

TSLint prints lint error in the console as:

ERROR: /Users/Ali/workspace/x/y/z/Test.ts[172, 14]: Parentheses are prohibited around the parameter in this single parameter arrow function

After running TSLint, I'd like to copy the error path, go to the IDE (VSCode), and then directly go to the error positions. There are two problems with the way line and column numbers are printed:

  • there is a space between comma and the column number and macOS terminal fails to select the full path.
  • VScode does not recognize square brackets, e.g, [172,14] as a line and column numbers. TypeScript compiler uses () for reporting line and columns and that works fine with VSCode.

Expected behavior

I'd like to see the error message as:

ERROR: /Users/Ali/workspace/x/y/z/Test.ts(172,14): Parentheses are prohibited around the parameter in this single parameter arrow function

I can also create a Pull Request for this isse if this is something you think more people may find useful.

@aervin
Copy link
Contributor

aervin commented Dec 22, 2017

@afroozeh Does the --formatter msbuild option help? And if using the VSCode terminal, (command + click)-ing the file paths takes the cursor directly to the start of the error in the editor pane.

@afroozeh
Copy link
Author

@aervin Thanks! --format msbuild produces the output exactly the way I wanted.

@adidahiya
Copy link
Contributor

This has also been fixed in the stylish formatter (#3491).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants