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

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


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

偶然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' }], //加这一句
  },
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容