search

Home  >  Q&A  >  body text

javascript - How to replace CRLF with LF in the editor under windows?

I have recently been using the code format verification tool: eslint, which has introduced a certain verification standard.

But every time I verify, the verification tool will prompt me that I am using CRLF and want me to replace it with LF.

I would like to ask everyone, how should this be replaced? Is it okay to use regular expressions?

黄舟黄舟2734 days ago1162

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-06-29 10:11:46

    vscode has this function

    reply
    0
  • 高洛峰

    高洛峰2017-06-29 10:11:46

    Replace with a regular expression, replace rn with n. Among them, r refers to CR, and n refers to LF.

    But generally speaking, most IDEs and editors have the option to directly switch the newline end character, such as the SublimeText I use:

    reply
    0
  • Cancelreply