fix: ensure final line is LF-terminated#318
Open
Renegade334 wants to merge 1 commit intoelectron:mainfrom
Open
fix: ensure final line is LF-terminated#318Renegade334 wants to merge 1 commit intoelectron:mainfrom
Renegade334 wants to merge 1 commit intoelectron:mainfrom
Conversation
dsanders11
requested changes
Jan 22, 2026
Member
dsanders11
left a comment
There was a problem hiding this comment.
This change seems fine, IMO, but I'd like to see the implementation tweaked, and test coverage added.
For implementation, I think it makes more sense to add the trailing newline on L125, at the end of generateDefinitions rather than at the end of appendNodeJSOverride, since the former ensures it's always a trailing newline, while the latter could be moved in the future and we'd no longer get the trailing newline as intended.
For test coverage, I think just adding expect(output.endsWith('\n')).toEqual(true); or equivalent into the "should output a electron.d.ts file" test in test/output.spec.ts should suffice, with an update to the test name to signify that the newline is expected as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The final line of electron.d.ts is currently not terminated with a newline. Given that this would be a lint error in the source, it may as well be consistent in the output.