We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前一直在 Windows 下进行 Web 开发,但是部分项目中用到的 ESLint 默认要求换行符格式为 LF,而 Windows 下创建的文件,换行符格式默认是 CRLF,这样 ESLint 就总会报告说文件的换行符不正确。
LF
CRLF
Google eslint linebreak-style cr crlf 找到了解决方案:How can I write a ESLint rule for "linebreak-style", changing depending on Windows or Unix?,用下面的代码,让 ESLint 根据当前操作系统来决定什么样的换行符是合法的。
eslint linebreak-style cr crlf
"rules": { "linebreak-style": ["error", (process.platform === "win32" ? "windows" : "unix")], }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
目前一直在 Windows 下进行 Web 开发,但是部分项目中用到的 ESLint 默认要求换行符格式为
LF
,而 Windows 下创建的文件,换行符格式默认是CRLF
,这样 ESLint 就总会报告说文件的换行符不正确。解决方案
Google
eslint linebreak-style cr crlf
找到了解决方案:How can I write a ESLint rule for "linebreak-style", changing depending on Windows or Unix?,用下面的代码,让 ESLint 根据当前操作系统来决定什么样的换行符是合法的。The text was updated successfully, but these errors were encountered: