Sublime text to atom, Javascript Error


#1

So I am using Atom and my friend uses Sublime text, when he send me a Javascript file all the codes got an Error

need help to fix it please


#2

Which operating systems are you two guys using?


#4

Im using macOS, he is using Windows 10…


#5

The line-break errors could indeed be related to the different operating systems you are using: Windows uses \r\n, the rest of the world \n.

As for the other errors, do you use the same linter (JSCS) and linter settings? What about indentation settings?

I recommend using EditorConfig to ensure you work using the same settings across different editors (encoding, indentation, etc.). This will make sure you use the same settings for the project without having to change your global preferences.

Related:


#6

EditorConfig is a great tool, as suggested by @idleberg. If you work with other people on the same project, and there is no unique editor currently being used, that tool can save you some sweat.
As for the newlines, maybe you can run a Find-and-Replace with a regex, by replacing all the \r\n with \n only.