From b19fd17fd0b260a20fa2f16b5d85bc4381a45084 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Mon, 20 Nov 2017 13:57:48 -0600 Subject: [PATCH 1/7] Fix eslint errors on Windows On Windows, when run `npm run lint`, a **LOT** of the following errors appeared: ``` error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style ``` This error only occurs on Windows because the `linebreak-style` eslint setting was set to "unix". This is fixed by making the eslint config file a Javascript script and setting the platform based on the build platform. Thus, the `linebreak-style` will be "windows" or "unix" depending on the users platform. --- .eslintrc.json => .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .eslintrc.json => .eslintrc.js (83%) diff --git a/.eslintrc.json b/.eslintrc.js similarity index 83% rename from .eslintrc.json rename to .eslintrc.js index 2a14b903f9..0b443c2945 100644 --- a/.eslintrc.json +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -{ +module.exports = { "root": true, "extends": "eslint:recommended", "env": { @@ -15,7 +15,7 @@ }, "rules": { "indent": ["error", 2], - "linebreak-style": ["error", "unix"], + "linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")], "no-trailing-spaces": 2, "eol-last": 2, "space-in-parens": ["error", "never"], From fd1769705b22d964e137b1eeb218f2ac1a77779f Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Tue, 21 Nov 2017 19:25:23 -0600 Subject: [PATCH 2/7] Remove linespace ending check in Lint Add .gitattributes that will convert line endings automatically to LF when uploading to GitHub --- .eslintrc.js => .eslintrc.json | 3 +-- .gitattributes | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) rename .eslintrc.js => .eslintrc.json (83%) create mode 100644 .gitattributes diff --git a/.eslintrc.js b/.eslintrc.json similarity index 83% rename from .eslintrc.js rename to .eslintrc.json index 0b443c2945..fd7383f879 100644 --- a/.eslintrc.js +++ b/.eslintrc.json @@ -1,4 +1,4 @@ -module.exports = { +{ "root": true, "extends": "eslint:recommended", "env": { @@ -15,7 +15,6 @@ module.exports = { }, "rules": { "indent": ["error", 2], - "linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")], "no-trailing-spaces": 2, "eol-last": 2, "space-in-parens": ["error", "never"], diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..6ed8a77488 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +* text=auto + +*.js text +*.html text +*.less text +*.json text +*.css text +*.xml text +*.md text + +*.sh text eol=lf +*.bat text eol=crlf From 820575d4de7e9b5e60454dc6ee87423a159dd7cd Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Wed, 22 Nov 2017 08:36:46 -0600 Subject: [PATCH 3/7] Remove bat file extension from gitattributes Include lint check for line endings --- .eslintrc.json => .eslintrc.js | 3 ++- .gitattributes | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) rename .eslintrc.json => .eslintrc.js (84%) diff --git a/.eslintrc.json b/.eslintrc.js similarity index 84% rename from .eslintrc.json rename to .eslintrc.js index fd7383f879..ae15fefb07 100644 --- a/.eslintrc.json +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -{ +module.exports = { "root": true, "extends": "eslint:recommended", "env": { @@ -15,6 +15,7 @@ }, "rules": { "indent": ["error", 2], + "linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")], "no-trailing-spaces": 2, "eol-last": 2, "space-in-parens": ["error", "never"], diff --git a/.gitattributes b/.gitattributes index 6ed8a77488..51c2fb2c05 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,4 +9,3 @@ *.md text *.sh text eol=lf -*.bat text eol=crlf From 449487d3cea28676c9b087da51c66c6b2c775446 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Wed, 22 Nov 2017 08:38:37 -0600 Subject: [PATCH 4/7] Change tabs to spaces --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index ae15fefb07..0b443c2945 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,7 +15,7 @@ module.exports = { }, "rules": { "indent": ["error", 2], - "linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")], + "linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")], "no-trailing-spaces": 2, "eol-last": 2, "space-in-parens": ["error", "never"], From 3daa1c9a20a5fcb3dd91a3f824300a079d60eec1 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Thu, 23 Nov 2017 09:34:11 -0600 Subject: [PATCH 5/7] Force LF line endings for each file upon downloading Restore eslint linebreak style check for unix since LF line endings will be enforced --- .eslintrc.js => .eslintrc.json | 4 ++-- .gitattributes | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename .eslintrc.js => .eslintrc.json (83%) diff --git a/.eslintrc.js b/.eslintrc.json similarity index 83% rename from .eslintrc.js rename to .eslintrc.json index 0b443c2945..2a14b903f9 100644 --- a/.eslintrc.js +++ b/.eslintrc.json @@ -1,4 +1,4 @@ -module.exports = { +{ "root": true, "extends": "eslint:recommended", "env": { @@ -15,7 +15,7 @@ module.exports = { }, "rules": { "indent": ["error", 2], - "linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")], + "linebreak-style": ["error", "unix"], "no-trailing-spaces": 2, "eol-last": 2, "space-in-parens": ["error", "never"], diff --git a/.gitattributes b/.gitattributes index 51c2fb2c05..77124fad36 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -* text=auto +* text=auto eol=lf *.js text *.html text @@ -8,4 +8,4 @@ *.xml text *.md text -*.sh text eol=lf +*.sh text From f21f298f5f82472d7d41e29a301880bd7571f7b3 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Fri, 24 Nov 2017 22:18:38 -0600 Subject: [PATCH 6/7] Add a few more text files to the gitattributes --- .gitattributes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 77124fad36..084de1747c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,5 +7,7 @@ *.css text *.xml text *.md text - +*.txt text +*.yml text +*.sql text *.sh text From b6f1acfafbf3240829986a83c555ce16713d54ce Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Fri, 24 Nov 2017 22:36:31 -0600 Subject: [PATCH 7/7] Added png as binary file to gitattributes file This was necessary because git was showing that the CRLF line endings were being converted to LF for PNG files on Windows --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index 084de1747c..23b2493344 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,3 +11,5 @@ *.yml text *.sql text *.sh text + +*.png binary \ No newline at end of file