方法一 在prettierrc文件 添加 “endOfLine”: “auto”

{
  "useTabs": false,
  "tabWidth": 2,
  "printWidth": 100,
  "singleQuote": true,
  "trailingComma": "es5",
  "bracketSpacing": true,
  "semi": true,
  "endOfLine": "auto"// 增加这一行
}

方法二 .eslintrc.js 文件添加 “endOfLine”: “auto”

module.exports = {
  parser: "@typescript-eslint/parser",
  ... ,
  rules: {
  	...,
    "@typescript-eslint/no-explicit-any": "off",
    validateLineBreaks: "CRLF",// 增加这一行
  },
};
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐