123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- module.exports = {
- // Airbnb is the base, prettier is here so that eslint doesn't conflict with prettier
- extends: ['airbnb', 'prettier', 'prettier/react'],
- parser: 'typescript-eslint-parser',
- plugins: ['react-native', 'typescript'],
- rules: {
- // Parens will be needed for arrow functions
- 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
- // Lines will be broken before binary operators
- 'operator-linebreak': ['error', 'before'],
- // Allow imports from dev and peer dependencies
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true, peerDependencies: true },
- ],
- // Allows writing JSX in JS & TS files
- 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
- // This rule doesn't play nice with Prettier
- 'react/jsx-one-expression-per-line': 'off',
- // This rule doesn't play nice with Prettier
- 'react/jsx-wrap-multilines': 'off',
- // Remove this rule because we only destructure props, but never state
- 'react/destructuring-assignment': 'off',
- // Restrict imports that should be used carefully. Usually we have created a wrapper around them
-
- 'typescript/adjacent-overload-signatures': 'error',
- 'typescript/explicit-function-return-type': 'error',
- 'typescript/no-angle-bracket-type-assertion': 'error',
- 'typescript/no-empty-interface': 'error',
- 'typescript/no-explicit-any': 'error',
- 'typescript/no-inferrable-types': 'error',
- 'typescript/no-namespace': 'error',
- 'typescript/no-non-null-assertion': 'error',
- 'typescript/no-triple-slash-reference': 'error',
- 'typescript/prefer-namespace-keyword': 'error',
- 'typescript/type-annotation-spacing': 'error',
-
- 'no-unused-vars': 'off',
- },
- settings: {
- 'import/resolver': {
- node: {
- extensions: [
- '.js',
- '.jsx',
- '.tsx',
- '.ts',
- '.android.tsx',
- '.android.ts',
- '.ios.tsx',
- '.ios.ts',
- ],
- },
- },
- },
- };
|