-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
fix(node): #1180 - Adjust tsconfig compiler options #1456
Conversation
Accidentally applied `es6` when compilerOptions.module was not defined.
Thanks for looking into that! I was about to create a MCVE on a dummy repo but you beat me to finding a fix :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. This fix seems consistent with how the issue was introduced.
Not sure how easy this request is, but it feels like it’d be ideal to have a test case for this?
@fbartho I'd love to hear your thoughts on how to test this. I noticed the __Dangerfile fixtures but I don't see anything that sets up a project to trigger this issue given the interplay with existing tsconfig settings. I'm confident I could work something up if desired. Maybe a unit test would be sufficient as well though I like the scaffolding around full project testing to more easily diagnose failures. |
@matthewh I was equally curious re the tests. This feels like it falls in the bucket of a pain to setup a test environment. (I don't have any obvious/easy advice, hence my PR approval) Once a year for the last few years I tripped over ESM issues for various projects, and tripped across edge cases with TypeScript, and I wasn't looking forward to needing to solve them here in DangerJS! At least this works with the setups we have tested, so that's incremental, good, progress in my opinion. |
@fbartho I think the variants distill to the following:
† why does danger need to use the current tsconfig at all? Because dangerfile imports live inside the current project. This seems messy when we consider that danger runs on top of a project and should never be a dependency. Ideally, I'd run |
No objections to your comments about the variants! I don't think the way forwards is as obvious as you suggest @matthewh,
For example I strongly disagree with using
I think you're right this would be a hell of a lift. I also don't think it's obvious that |
then when danger runs it would "npm install" these as needed. It's an interesting problem space. |
Cool, discussion makes sense but lets get this shipped and folks can decide if there's more to do |
Accidentally applied
es6
when compilerOptions.module was not defined.I recognize posting an error message to indicate a successful fix isn't great practice but I'm testing locally and this at least proves the code transpiled correctly and executed and failed once danger realized it's not inside a github PR.
"Success"
Addresses original error