module.exports = { root: true, extends: '@react-native-community', parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'import', 'react-hooks'], overrides: [ { files: ['*.ts', '*.tsx'], rules: { '@typescript-eslint/no-shadow': ['error'], 'no-shadow': 'off', 'no-undef': 'off', 'no-unused-expressions': ['error', { allowShortCircuit: true }], 'no-use-before-define': ['error', { variables: false }], 'no-empty': ['error', { allowEmptyCatch: true }], 'lines-between-class-members': 'off', 'arrow-body-style': ['error', 'as-needed'], 'react/destructuring-assignment': ['warn', 'always', { ignoreClassFields: true }], 'react/jsx-one-expression-per-line': 'off', 'react/prefer-stateless-function': 'warn', 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'off', 'react-native/no-inline-styles': 'error', 'import/order': [ 'warn', { groups: ['builtin', 'external', 'internal', ['sibling', 'parent'], 'index'], pathGroups: [ { pattern: 'react', group: 'external', position: 'before', }, ], pathGroupsExcludedImportTypes: ['react'], 'newlines-between': 'always-and-inside-groups', alphabetize: { order: 'asc', caseInsensitive: true, }, }, ], 'import/first': 'error', 'import/newline-after-import': 'error', // suppress errors for missing 'import React' in files 'react/react-in-jsx-scope': 'off', // allow jsx syntax in js files 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }], }, }, ], settings: { 'import/extensions': ['.js', '.jsx', '.ts', '.tsx', '.svg', '.native.js'], 'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'], }, 'import/resolver': { 'babel-module': {}, }, }, };