Skip to content

Commit

Permalink
chore: add .gitattributes and change tsconfig.json for consistent EOL…
Browse files Browse the repository at this point in the history
… semantic

Apply the same changes as in open-telemetry/opentelemetry-js#1550
in this repo to improve OS independent development.
  • Loading branch information
Flarna committed Dec 18, 2020
1 parent 19f4319 commit a558e43
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## This .gitattributes file automatically formats the EOL character in certain filetypes within the repository

## Source code
# JavaScript, TypeScript, c, and h source files
*.js text eol=lf
*.ts text eol=lf
*.h text eol=lf diff=cpp
*.c text eol=lf diff=cpp

# Shell scripts
*.sh text eol=lf
*.bash text eol=lf

# Windows batch and PowerShell scripts
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

##### Other file types #####

## Text files and documentation
*.txt text
README* text
RELEASING* text
CHANGELOG* text
CONTRIBUTING* text
INSTALL* text
LICENSE* text

## Non-text documentation
*.html text diff=html
*.pdf binary
*.json text
*.rtf binary

## Git Properties
.gitignore text
.gitmodules text
.gitattributes text
2 changes: 1 addition & 1 deletion scripts/version-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ export const VERSION = '${pjson.version}';

const fileUrl = path.join(appRoot, "src", "version.ts")

fs.writeFileSync(fileUrl, content.replace(/\n/g, os.EOL));
fs.writeFileSync(fileUrl, content);
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"strict": true,
"strictNullChecks": true,
"target": "es2017",
"incremental": true
"incremental": true,
"newLine": "LF"
},
"exclude": [
"node_modules"
Expand Down

0 comments on commit a558e43

Please sign in to comment.