From dd55bbe70017b488eb5f5d97592c44c8c6424aaf Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Sat, 25 Nov 2017 15:06:52 -0600 Subject: [PATCH] Fix eslint errors on Windows (#4364) * 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. * Remove linespace ending check in Lint Add .gitattributes that will convert line endings automatically to LF when uploading to GitHub * Remove bat file extension from gitattributes Include lint check for line endings * Change tabs to spaces * Force LF line endings for each file upon downloading Restore eslint linebreak style check for unix since LF line endings will be enforced * Add a few more text files to the gitattributes * 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..23b24933 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +* text=auto eol=lf + +*.js text +*.html text +*.less text +*.json text +*.css text +*.xml text +*.md text +*.txt text +*.yml text +*.sql text +*.sh text + +*.png binary \ No newline at end of file