Skip to content

Commit

Permalink
Generated docs should use Unix line endings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ybnd committed Apr 25, 2024
1 parent 145a0a0 commit 348dcc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lint/generate-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 348dcc4

Please sign in to comment.