.eslintrc.js 991 B

1234567891011121314151617181920212223242526272829303132333435
  1. module.exports = {
  2. extends: [require.resolve('@umijs/fabric/dist/eslint')],
  3. globals: {
  4. ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
  5. page: true,
  6. REACT_APP_ENV: true
  7. },
  8. rules: {
  9. semi: ['error', 'never'],
  10. 'no-multiple-empty-lines': [1, { max: 2 }],
  11. 'no-use-before-define': 'off',
  12. '@typescript-eslint/no-use-before-define': ['error'],
  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. }
  35. }