.eslintrc.js 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
  2. const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');
  3. module.exports = {
  4. extends: ['@react-native-community'],
  5. overrides: [
  6. {
  7. files: ['./mock.js'],
  8. env: {jest: true},
  9. },
  10. {
  11. files: ['*.ts', '*.tsx'],
  12. // Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
  13. rules: Object.assign(
  14. typescriptEslintRecommended.rules,
  15. typescriptEslintPrettier.rules,
  16. {
  17. '@typescript-eslint/explicit-member-accessibility': 'off',
  18. '@typescript-eslint/no-empty-function': 'off',
  19. },
  20. ),
  21. },
  22. {
  23. files: ['example/**/*.ts', 'example/**/*.tsx'],
  24. rules: {
  25. // Turn off rules which are useless and annoying for the example files files
  26. '@typescript-eslint/explicit-function-return-type': 'off',
  27. 'react-native/no-inline-styles': 'off',
  28. },
  29. },
  30. ],
  31. };