-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: consolidate diagnostics
funcs into single file
#416
refactor: consolidate diagnostics
funcs into single file
#416
Conversation
- move `IDiagnostic` and `convertDiagnostic` from `tscache` to `print-diagnostics`, then rename it to `diagnostics.ts` - the diagnostic funcs being in `tscache` always felt like a strange place for them - especially when `parse-tsconfig` or `print-diagnostics` would import them from `tscache`, which sounded like an unrelated file - may want to move `diagnostics-format-host` into this file as well, as it is _only_ used in this file - leaving as is for now, limiting this change to a smaller one
- this was previously only covered in integration tests - since unit tests don't currently touch `index` or `tscache`, and `convertDiagnostic` was previously in `tscache` - another reason why consolidating these functions into one file made sense
7072019
to
2d3cfe3
Compare
- since new lines are host OS specific - this fixes the `convertDiagnostic` test on Windows too, where it was failing
Well this was pretty ironic -- the unit test I added actually fails on Windows without this fix (and a test adjustment). Given that I'm on Mac, I literally didn't see this until it hit CI after I wrote up the PR. Turns out the test confirms this behavior! |
@ezolenko friendly ping in case you just hadn't seen this PR (since you merged some others, but not this one) I also think we should be good to release There's a couple more things that I'm working on, but those will probably take some time (not spending as much time on rpt2 anymore since I've fixed the vast majority of issues! 🙂), so don't want to hold back releasing #406 because of that, since it's a big fix for what is probably the single most common issue in this repo. |
Summary
diagnostics
funcs into a single file nameddiagnostics.ts
check-tsconfig
withparse-tsconfig
#413)convertDiagnostic
\n
->formatHost.getNewLine()
Details
refactor:
move
IDiagnostic
andconvertDiagnostic
fromtscache
toprint-diagnostics
, then rename it todiagnostics.ts
tscache
always felt like a strange place for themparse-tsconfig
orprint-diagnostics
would import them fromtscache
, which sounded like an unrelated filemay want to move
diagnostics-format-host
into this file as well, as it is only used in this filetest: add unit test for
convertDiagnostic
index
ortscache
, andconvertDiagnostic
was previously intscache
fix(diagnostics): use
formatHost.getNewLine()
instead of\n