Skip to content

fix: ensure final line is LF-terminated#318

Open
Renegade334 wants to merge 1 commit intoelectron:mainfrom
Renegade334:terminating-newline
Open

fix: ensure final line is LF-terminated#318
Renegade334 wants to merge 1 commit intoelectron:mainfrom
Renegade334:terminating-newline

Conversation

@Renegade334
Copy link

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.

@Renegade334 Renegade334 requested review from a team as code owners January 21, 2026 22:59
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo this seems reasonable

Copy link
Member

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants