.eslintrc.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module.exports = {
  2. root: true,
  3. extends: '@react-native',
  4. rules: {
  5. // 关闭分号要求
  6. semi: 'off',
  7. // 关闭引号风格检查
  8. quotes: 'off',
  9. // 关闭逗号风格检查
  10. 'comma-dangle': 'off',
  11. // 关闭未定义变量检查(全局变量)
  12. 'no-undef': 'off',
  13. // 关闭未使用变量检查
  14. 'no-unused-vars': 'warn',
  15. // 关闭 == 和 === 强制检查
  16. eqeqeq: 'off',
  17. // 关闭空组件自闭合检查
  18. 'react/self-closing-comp': 'off',
  19. // 关闭 React Hooks 依赖检查
  20. 'react-hooks/exhaustive-deps': 'warn',
  21. // 关闭字符串中花括号空格检查
  22. 'react/jsx-curly-spacing': 'off',
  23. // 关闭 JSX 缩进检查
  24. 'react/jsx-indent': 'off',
  25. // 关闭操作符空格检查
  26. 'space-infix-ops': 'off',
  27. // 关闭关键字空格检查
  28. 'keyword-spacing': 'off',
  29. // 关闭对象花括号空格检查
  30. 'object-curly-spacing': 'off',
  31. // 关闭数组括号空格检查
  32. 'array-bracket-spacing': 'off',
  33. // 关闭尾随空格检查
  34. 'no-trailing-spaces': 'off',
  35. // 关闭多余空行检查
  36. 'no-multiple-empty-lines': 'off',
  37. // 关闭 console 检查
  38. 'no-console': 'off',
  39. // 关闭 Prettier 检查
  40. 'prettier/prettier': 'off',
  41. },
  42. };