-
Notifications
You must be signed in to change notification settings - Fork 887
Prose formatter to output relative file paths #4223
Comments
@reduckted how about We should also figure out what the paths should be relative to. Is it always the root directory being run from? Do monorepos or global installs have different needs? |
Yep, that sounds like a good idea. Looking at the type of output from each formatter and whether it's designed to be parsed, here's my thoughts on which ones should use relative paths: ✔️ codeFrame ❌ checkstyle ❔ verbose (it's not really made for parsing, but given its name is "verbose", maybe it should show the full path 🤷♂️ ).
The current working directory would match what TypeScript's Some other options: Relative to the project file Relative to the |
#2228 tracks removing prose and #3460 tracks merging prose into verbose. Neither formatter is really made for API consumption given how much better the json formatter is. It should be an acceptable (though still breaking) change to make them use relative paths.
Agreed, maintaining parity with TypeScript seems like best foot forward. It'd be a shame to be surprising to users and have them constantly confuse which tool has which behavior. I know I would! If file path relativity or root-ness really becomes important, it would be nice to have formatter options. Filed #4281. Side note: love the use of emojis on that list! Very helpful! 🙌 |
Feature request
Is your feature request related to a problem? Please describe.
The prose formatter lists problems with the full path to the file. This causes a lot of redundant text in the output, and makes it harder to read.
Describe the solution you'd like
I would like the prose formatter (and maybe other formatters if appropriate, though I only use the prose formatter) to display relative file paths instead of absolute file paths.
The path could be relative from the current working directory, or perhaps from the directory of the
tsconfig.json
file (the current working directory feels like the better option).Describe alternatives you've considered
None.
Additional context
Here's an example of the current output that I see when I run TSLint on a particular repository:
Here is what I would like to see:
The text was updated successfully, but these errors were encountered: