Eslint和prettier冲突解决

479 阅读1分钟

缩进冲突时配置以下rules

 rules: {
    'prettier/prettier': ['error', {
      endOfLine: 'auto',
      trailingComma: 'es5',
      tabWidth: 2, // 设置缩进为2个空格
      semi: true,
      singleQuote: true,
      jsxSingleQuote: true,
    }],
    indent: ['error', 2, { SwitchCase: 1 }], // 设置缩进为2个空格
    'react/prop-types': 'off',
  },
};