cocos 开发环境标准配置选项:
git 环境:
配置自动转换换行符:false
git config --global core.autocrlf false
这一步是为了在windows环境下 文件结束符保持\n, 否则cocos 中的meta文件在刷新时会因为\n 而产生变更记录,影响提交列表.
webstorm/ vscode 保持换行符为:\n
WebStorm: File->Settings -> Editor/CodeStyle -> General ==> Line separator : \n
VsCode: File-> Preferences -> Text Editor => Eol: \n
这一步保证ide新建/修改文件也是以\n结尾,而非\r\n, 因为git提交时的自行换行转换已被关闭,所以代码中的\r\n不会被转换成\n.
webstorm/vscode 文件编码设置: utf-8
WebStorm: File->Settings -> Editor/File Encodings=> Global Encoding:UTF-8, ProjectEncoding:UTF-8,Default encoding for propertities file: UTF-8
VsCode: File-> Preferences -> Text Editor => Encoding: utf8