$ npm run lint
/Users/john/test/src/index.ts
274:35 warning 'event' is defined but never used @typescript-eslint/no-unused-vars
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
The terminal isn’t smart enough to do that. For it to hyperlink straight to a location in a file, the path would have to be immediately followed by a colon and the location, i.e.
/Users/john/test/src/index.ts:274:35
.Instead, you might consider installing a plugin, or configuring an existing one, to show lint results in the Problems view. VSCode will then link straight to the location. I don’t have any recommendations since I don’t work in TypeScript myself, but FWIW, the Python extension can do that, for example with the Pylama linter enabled.
You may want to use a different formatter to have the problems printed in a way that lets you open the respective lines by clicking on a link in the terminal.
This should work out of the box:
and print
Or this one:
which prints
To avoid specifying the formatter manually every time, you could add them directly to the
"lint"
script defined in the file package.json, e.g.: