.eslintrc.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // eslint-disable-next-line no-undef
  2. module.exports = {
  3. // eslint-disable-next-line no-undef
  4. extends: [require.resolve('@umijs/fabric/dist/eslint')],
  5. globals: {
  6. ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
  7. page: true,
  8. REACT_APP_ENV: true
  9. },
  10. rules: {
  11. semi: ['error', 'never'],
  12. 'no-multiple-empty-lines': [1, { max: 2 }],
  13. 'no-use-before-define': 'off',
  14. 'comma-dangle': [2, 'never'],
  15. 'react/prop-types': 0,
  16. 'spaced-comment': 'error',
  17. 'react/no-array-index-key': 0,
  18. // 'array-bracket-spacing': ['error', 'always'], // 和prettier冲突
  19. 'object-curly-spacing': ['error', 'always'],
  20. // 'no-use-before-define': ['error', { functions: false }], // 允许在未定义function前调用
  21. 'react/self-closing-comp': [
  22. 'error',
  23. {
  24. component: true,
  25. html: true
  26. }
  27. ],
  28. 'react-hooks/exhaustive-deps': 0,
  29. 'no-unused-expressions': [
  30. 'error',
  31. {
  32. allowShortCircuit: true
  33. }
  34. ],
  35. '@typescript-eslint/no-unused-expressions': 0
  36. }
  37. }