Issue: Honour file ending rules in data files #291

Closed
opened 2026-10-05 02:38:17 +02:00 by adam · 1 comment
Owner

Editing a data file via frontMatter.data.files and Dashboard > Data results in the saved/changed file being saved without "newline at the end of the file". My linting rules expect a newline, so my linting always results in an extra step to add a new line.

Would it be possible to somehow check the file before changing it and using the existing characters after the json is closed (] or }) somehow? Or maybe add a config variable that enables newline/no-newline for edited files?

Editing a data file via `frontMatter.data.files` and Dashboard > Data results in the saved/changed file being saved without "newline at the end of the file". My linting rules expect a newline, so my linting always results in an extra step to add a new line. Would it be possible to somehow check the file before changing it and using the existing characters after the json is closed (] or }) somehow? Or maybe add a config variable that enables newline/no-newline for edited files? <!-- github-sync-id:1285995595 -->
adam closed this issue 2026-10-05 02:38:17 +02:00
Author
Owner

@davidsneighbour instead of checking the file, I'll use the files.insertFinalNewLine setting from VS Code.

image

@davidsneighbour instead of checking the file, I'll use the `files.insertFinalNewLine` setting from VS Code. ![image](https://user-images.githubusercontent.com/2900833/176114811-fef4607b-0154-4e34-9a70-aab6e935d86e.png) <!-- github-comment-id:1168315046 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#291