EOL semantics by adding .gitattributes and changing tsconfig.json (#1550)
* style(opentelemetry-js): .gitattribute and tsconfig changes for EOL normalization * fix(opentelemetry-js): moved 'newLine': 'LF' into tsconfig.base instead of individual * fix(opentelemetry-js): changed version script to use LF instead of OS.EOL * fix(opentelemetry-js): simplified version script
This commit is contained in:
parent
e298eec9c4
commit
d610fb95f2
|
@ -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
|
|
@ -15,7 +15,8 @@
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"target": "es2017",
|
"target": "es2017",
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"newLine": "LF"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|
|
@ -45,4 +45,4 @@ export const VERSION = '${pjson.version}';
|
||||||
|
|
||||||
const fileUrl = path.join(appRoot, "src", "version.ts")
|
const fileUrl = path.join(appRoot, "src", "version.ts")
|
||||||
|
|
||||||
fs.writeFileSync(fileUrl, content.replace(/\n/g, os.EOL));
|
fs.writeFileSync(fileUrl, content);
|
||||||
|
|
Loading…
Reference in New Issue