Skip to content

Commit 3d17386

Browse files
fix: problems running auto-changelog on Windows (#246)
Problems around /r/n or CRLF --------- Co-authored-by: Jongsun Suh <jongsun.suh@icloud.com>
1 parent 24fcaf3 commit 3d17386

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ root = true
33
[*]
44
indent_style = space
55
indent_size = 2
6-
end_of_line = lf
76
charset = utf-8
87
trim_trailing_whitespace = true
98
insert_final_newline = true

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ module.exports = {
2525
],
2626

2727
ignorePatterns: ['!.eslintrc.js', 'dist'],
28+
29+
rules: {
30+
// This is necessary to run eslint on Windows and not get a thousand CRLF errors
31+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
32+
},
2833
};

.prettierrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ module.exports = {
55
singleQuote: true,
66
tabWidth: 2,
77
trailingComma: 'all',
8+
endOfLine: 'auto',
89
plugins: ['prettier-plugin-packagejson'],
910
};

src/parse-changelog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function parseChangelog({
5454
packageRename?: PackageRename;
5555
shouldExtractPrLinks?: boolean;
5656
}) {
57-
const changelogLines = changelogContent.split('\n');
57+
const changelogLines = changelogContent.split(/(?:\r)?\n/u); // Split on either Windows or Unix line endings
5858
const changelog = new Changelog({
5959
repoUrl,
6060
tagPrefix,

0 commit comments

Comments
 (0)