Skip to content

Commit

Permalink
fix: add .gitattributes to help with line endings, reducing Windows i…
Browse files Browse the repository at this point in the history
…ssues

As recommended by Prettier.
Fixes #39
  • Loading branch information
haoqunjiang committed Jan 14, 2025
1 parent 3fbbc46 commit 3c0df25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ export default function createConfig({
)
}

if (styleGuide !== 'standard' || needsPrettier) {
// TODO:
// I used renderEjsFile instead of readFileSync for simplicity and easier integration
// with create-vue. But it's ugly.
// Should refactor later, or move this project into create-vue.
files['.gitattributes'] = renderEjsFile('./templates/_gitattributes', {})
}

return {
pkg,
files,
Expand Down
1 change: 1 addition & 0 deletions templates/_gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf

0 comments on commit 3c0df25

Please sign in to comment.