generated from leotm/react-native-template-new-architecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
80 lines (80 loc) · 2.37 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-typescript-prettier',
'plugin:jest/all',
'plugin:react/all',
'plugin:react-hooks/recommended',
'react-native-typescript',
'plugin:react-native/all',
// '@react-native-community',
// 'plugin:prettier/recommended',
'plugin:yml/prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest'
},
overrides: [
{
files: ['*.yaml', '*.yml'],
parser: 'yaml-eslint-parser',
rules: {
'spaced-comment': 'off',
'yml/flow-sequence-bracket-spacing': ['error', 'always'],
}
}
],
env: {
'react-native/react-native': true,
'jest/globals': true,
},
ignorePatterns: [
'lib/',
'babel.config.js',
'metro.config.js',
'.eslintrc.js',
'!/.github'
],
plugins: [
'deprecation'
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off', // Prefer type inference
'@typescript-eslint/explicit-module-boundary-types': 'off', // Prefer type inference
'jest/prefer-inline-snapshots': 'off', // Avoid inlining unreadable RN snapshots
'react/static-property-placement': 'off', // TS wants these defs inside the Class,
'jsx-a11y/accessible-emoji': 'off', // RN TS requires raw text in <Text>, not <span>
'react/jsx-no-literals': 'off',
'react/jsx-max-depth': 'off',
'react-native/no-raw-text': ['error', { skip: 'Text.Text' }], // https://github.com/Intellicode/eslint-plugin-react-native/issues/271
'react/function-component-definition': ['error', {
'namedComponents': 'arrow-function',
'unnamedComponents': 'arrow-function',
}],
'deprecation/deprecation': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-invalid-void-type': 'error',
'import/prefer-default-export': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'App.tsx',
'**/jest.{config,setup}.js',
'**/*{.,_}{test,spec}.{ts,tsx}',
'**/__tests__/**/*.{ts,tsx}',
'**/storybook/*.ts',
'**/stories/**/*.tsx',
],
},
],
},
}