Generated docs should use Unix line endings on Windows

This commit is contained in:
Yury Bondarenko
2024-04-25 12:13:41 +02:00
parent 145a0a04b6
commit 348dcc47fd
2 changed files with 6 additions and 3 deletions

5
.gitattributes vendored
View File

@@ -13,4 +13,7 @@
*.css eol=lf
*.scss eol=lf
*.html eol=lf
*.svg eol=lf
*.svg eol=lf
# Generated documentation should have LF line endings to reduce git noise
docs/lint/**/*.md eol=lf

View File

@@ -20,12 +20,12 @@ import { default as tsPlugin } from './src/rules/ts';
const templates = new Map();
function lazyEJS(path: string, data: object) {
function lazyEJS(path: string, data: object): string {
if (!templates.has(path)) {
templates.set(path, require('ejs').compile(readFileSync(path).toString()));
}
return templates.get(path)(data);
return templates.get(path)(data).replace(/\r\n/g, '\n');
}
const docsDir = join('docs', 'lint');