全栈开发

nestjs 新建项目,vscode prettier报错解决

2022-12-18  本文已影响0人  Angeladaddy

这个问题就困扰我很久,一直没法解决。具体表现如下:


就这个空格,一保存格式化就自动添加,烦不胜烦

偶然google到解决办法:在项目eslintrc.js中添加一行,症状就消失了,治好了我多年的颈椎病

  rules: {
    '@typescript-eslint/interface-name-prefix': 'off',
    '@typescript-eslint/explicit-function-return-type': 'off',
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
    'prettier/prettier': ['error', { endOfLine: 'off' }], //加这一句
  },
上一篇 下一篇

猜你喜欢

热点阅读