visual-studio-codeformattingline-endingseol

Line endings are not following default settings in VS Code


When I try to push to GitHub, everytime I keep getting such warnings:

warning: LF will be replaced by CRLF in app/bingey-api/models/user.js.
The file will have its original line endings in your working directory

Even though I changed my line endings setting to "/n" in these places:

User -> Text Editor -> Files -> Eol:

enter image description here

Also Workspace -> Text Editor -> Files -> Eol:

enter image description here

Also my ESLint options file has default line ending "\n":

enter image description here

And Prettier is also configured to default "\n" endline symbol:

enter image description here

This is weird, maybe someone knows where else should I change settings? Thank you.


Solution

  • FOUND SOLUTION:

    In VS Code go to Terminal -> New Terminal and try to look what is the value of your core.autocrlf parameter like that:

     git config --global --get core.autocrlf  
    

    If nothing shows it means that it is set to default value (which is false) Otherwise, set it to false:

     git config --global core.autocrlf false