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

--project option outputs absolute paths #3183

Closed
ajafff opened this issue Aug 29, 2017 · 6 comments
Closed

--project option outputs absolute paths #3183

ajafff opened this issue Aug 29, 2017 · 6 comments

Comments

@ajafff
Copy link
Contributor

ajafff commented Aug 29, 2017

Bug Report

  • TSLint version: 5.7.0
  • TypeScript version: 2.5.1
  • Running TSLint via: CLI

Actual behavior

tslint --project . outputs absolute paths.

Expected behavior

Since --outputAbsolutePaths is not used, tslint should print relative paths.

@ajafff
Copy link
Contributor Author

ajafff commented Sep 15, 2017

I looked into this. When using --project we pass the ts.Program to the linter, which contains the source files with their absolute paths. These paths are used by the formatter to format the output.

Possible solution:

  • Always use absolute paths in runner.ts. (not strictly necessary, but would simplify a lot of other stuff, too)
  • Somehow pass an option to the Formatter whether it should print relative or absolute paths.
    • requires a change for custom formatters
    • option needs to pass though Linter

@akaztp
Copy link

akaztp commented Sep 17, 2017

This absolute paths bug prevents from using tslint on VSCode running from a task, in the scenario where the tooling is ran in WSL and the editor in Windows. The output file paths are linux like paths, but the VSCode in Windows expects Windows formatted paths.

@ajafff
Copy link
Contributor Author

ajafff commented Sep 17, 2017

@akaztp that's probably better fixed in the formatter. What formatter are you using?

@akaztp
Copy link

akaztp commented Sep 17, 2017

I solved my problem using a beta extension of tslint that uses the TypeScript language server plugin, so I don't need the output of the tslint as a task, anymore.
Nonetheless, I wondered around the Verbose Formatter code to evaluate the option to remove the current folder from the absolute paths. But that smells bad to me... And the bug reported in this issue would still be unresolved.

@JoshuaKGoldberg
Copy link
Contributor

💀 It's time! 💀

TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. 😱

If you'd like to see this change implemented, you have two choices:

  • Recommended: Check if this is available in ESLint + typescript-eslint
  • Not Recommended: Fork TSLint locally 🤷‍♂️

👋 It was a pleasure open sourcing with you!

If you believe this message was posted here in error, please comment so we can re-open the issue!

@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

@palantir palantir locked and limited conversation to collaborators Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants