Linebreak errors with eslint
Owen-Mak opened this issue · 7 comments
I ran eslint in Windows and it generated a list of errors regarding line-break style. (see screenshot below).
Steps to reproduce:
- run
npm run eslint
Expected result:
No errors reported, but possible warnings.
Possible fix:
Following some research, I think the cause of the issue is from .eslintrc.yml . For windows users, we need to change the linebreak style from unix to windows.
I could not find any environment variables for eslint to detect the current operating system, which would allow users to run a separate set of rules for different OS.
Node version: 8.9.4
OS: Windows 7
try running npm run prettier
and it will fix it. Then change your editor to use LF
for these files.
I also wonder if we should remove the LF
eslint error, since Prettier will just fix them?
I tried npm run prettier
and got the following error:
I have attached the error log in to this message since I am not sure the cause.
@Owen-Mak, can you please try changing the package.json
file line 9 and 10 to this (uses \"
and \"
around the file glob pattern:
"prettier": "prettier --single-quote --write \"{tools,src,test}/**/*.{js,css}\"",
See https://stackoverflow.com/questions/48078281/run-prettier-on-windows. If that works, can you please send a Pull Request with the change?
The fix worked for windows and the prettier commands now work.
It is filed under PR#12
However, after running npm run prettier
successfully, the issues still remains when I run npm run eslint
.
@Owen-Mak can you look at https://help.github.com/articles/dealing-with-line-endings/#platform-windows and make sure you have git
's line endings configured properly?
You can do git checkout -- tools/csv2json.js
if you need to reset that.