123456789101112131415161718192021222324252627282930
  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. {'@typescript-eslint/explicit-member-accessibility': 'off'},
  17. ),
  18. },
  19. {
  20. files: ['example/**/*.ts', 'example/**/*.tsx'],
  21. rules: {
  22. // Turn off rules which are useless and annoying for the example files files
  23. '@typescript-eslint/explicit-function-return-type': 'off',
  24. 'react-native/no-inline-styles': 'off',
  25. },
  26. },
  27. ],
  28. };