Skip to content

Enforce CRLF in TS/JS files #55403

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

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Aug 16, 2023

For better or for worse, we format all JS/TS in this repo with CRLF line endings. I swear that this used to be caught by an ESLint rule, but I cannot figure out where. These lib.d.ts files were not CRLF as we did not lint lib.d.ts. But, we do now format them!

Unfortunately, vscode's formatting system does not notice line ending changes, so hitting save on these files doesn't do anything.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 16, 2023
@@ -4,6 +4,7 @@
"newLineKind": "auto",
Copy link
Member Author

Choose a reason for hiding this comment

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

I could change this but that feels like a bit much as it'll redo quite a few things, actually. Maybe that's okay and I should just override this in general?

@jakebailey
Copy link
Member Author

Ugh, this is my fault; in the dprint PR, I removed "linebreak-style": ["error", "windows"] as I had put it into the "style" section, but forgot to update the dprint PR to enforce CRLF, or just leave that rule behind.

@jakebailey jakebailey changed the title Enforce CRLF in typescript code Enforce CRLF in TS/JS files Aug 16, 2023
@jakebailey
Copy link
Member Author

I will note that I normally have "files.eol": "\r\n", set in settings.json, so it's theoretically better to set this for all files we format, but I don't think we care about it besides the ts/js given that's all we enforced before.

@jakebailey jakebailey merged commit 9ec52c0 into microsoft:main Aug 16, 2023
@jakebailey jakebailey deleted the dprint-crlf branch August 16, 2023 22:27
snovader pushed a commit to EG-A-S/TypeScript that referenced this pull request Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants