First - what on earth are inconsistent line endings? Let's look at what happens when you press ENTER on a PC based system vs a Unix based OS like OSX. A PC writes a CR/LF (carriage return / line feed) pair. A LF is '\n' or if you like hex 0x0A or 10 in decimal. A CR is '\r', 0x0D, 13 respectively. For you c/c++/c# programmers out there you've probably seen some string "Hello World\n" or "Hello World\r\n" - also noting we have a LF and CR/LF
Let's take the following text....
See cat run
Specifically if you look in a Hex Editor, the bytes in the file look like this on PC (note the highlight 0D 0A)
and like this on a Mac (note the missing 0D)
Why does this happen with Unity and Visual Studio? When Unity creates a C# file, it creates it by default with LF only as shown here.
Visual Studio will open this up without a problem and without notifying you of anything. You aren't mixing CR/LF with your LF. Now you go ahead and paste some code into here, or use some existing code snippets, or format the document, or rely on some auto-complete/formatting features and they may stick in CR/LF into this doc (as you are editing on a pc). Now you have a file with LF and CR/LF mixed in it. It's inconsistent, hence you get a dialog box like the first image shown above Visual Studio loads that file.
Also note that if you do tell Visual Studio to normalize the line endings (ie clicking yes in that first dialog) it will fix this issue, but for this file only.
We have another product called Visual Studio Code (the free cross platform code editor/debugger) which actually just has a little drop down to select line endings and doesn't prompt you either as its a cross platform code editor. Visual Studio (a very different product) on the other hand is a PC based only full-featured IDE and expects PC based line endings but of course _can_ work with either CR/LF, you just have to tell it not to warn you. It thinks its doing you a favor (some third party tools over the years actually get messed up by mixed line endings, so its generally a good idea to have consistent line endings in your project).