更漂亮,更随意的规则相互冲突

时间:2019-08-28 08:14:34

标签: eslint prettier

我更愿意在保存时更正语法,我认为大多数人都可以。但是,两者之间似乎存在冲突。我为我的有角项目(so ts)设置了它,但未通过es lint规则。这是这种情况:

public someFunc = ():void => {
  //code here
};

保存漂亮时,将分号;放在函数表达式的末尾,就像使用其他表达式一样。但是,eslint不喜欢那样,它使皮棉失败并给出错误:

  

不必要的分号

这是我的eslintrc.js

module.exports =  {
  parser:  '@typescript-eslint/parser',
  extends:  [
    'plugin:@typescript-eslint/recommended',
    'prettier/@typescript-eslint',
    'plugin:prettier/recommended',
  ],
 parserOptions:  {
    ecmaVersion:  2018,
    sourceType:  'module',  
  },
  rules:  {
  },
};

感谢您的帮助:)

0 个答案:

没有答案
相关问题