dividab / tsconfig-paths

Load node modules according to tsconfig paths, in run-time or via API.
MIT License
1.8k stars 100 forks source link

fix: show problematic file path when encountering malformed JSON5 #176

Closed fwouts closed 2 years ago

fwouts commented 3 years ago

In a large codebase with lots of tsconfig.json extending each other, when JSON5 parsing crashes, it can be unclear which tsconfig file was problematic. This should help point out the issue more easily.

Note: all formatting changes were caused by the pre-commit hook. I'd be happy to force-revert them if desired.

jonaskello commented 2 years ago

@fwouts Could you merge with master and push? After that I think we should be good to merge this.

fwouts commented 2 years ago

Done! Better late than never 🥳

codecov[bot] commented 2 years ago

Codecov Report

Merging #176 (f183055) into master (9a3c0ed) will increase coverage by 0.21%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
+ Coverage   67.76%   67.97%   +0.21%     
==========================================
  Files           9        9              
  Lines         304      306       +2     
  Branches       93       93              
==========================================
+ Hits          206      208       +2     
  Misses         92       92              
  Partials        6        6              
Impacted Files Coverage Δ
src/tsconfig-loader.ts 84.37% <100.00%> (+0.50%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9a3c0ed...f183055. Read the comment docs.

jonaskello commented 2 years ago

Thanks!