.eslintrc.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. },
  9. rules: {
  10. semi: ['error', 'never'],
  11. 'no-multiple-empty-lines': [1, { max: 2 }],
  12. 'no-use-before-define': 'off',
  13. 'comma-dangle': [2, 'never'],
  14. 'react/prop-types': 0,
  15. 'spaced-comment': 'error',
  16. 'react/no-array-index-key': 0,
  17. // 'array-bracket-spacing': ['error', 'always'], // 和prettier冲突
  18. 'object-curly-spacing': ['error', 'always'],
  19. // 'no-use-before-define': ['error', { functions: false }], // 允许在未定义function前调用
  20. 'react/self-closing-comp': [
  21. 'error',
  22. {
  23. component: true,
  24. html: true
  25. }
  26. ],
  27. 'react-hooks/exhaustive-deps': 0,
  28. 'no-unused-expressions': [
  29. 'error',
  30. {
  31. allowShortCircuit: true
  32. }
  33. ],
  34. '@typescript-eslint/no-unused-expressions': 0
  35. }
  36. }