BUG: Add trailing trailing newline in to_json
- [x] closes #36888
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

can you add a test for this > can you add a test for this

@jbrockmendel Yes. Will do that @jbrockmendel added a test for the bug. And also fixed the breaking tests. cc @WillAyd Can anyone of you complete the PR. @jbrockmendel @WillAyd . There will be again a lot of conflicts if delayed 👍  thanks @Rohith295 