-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-native-ts.js
144 lines (144 loc) · 4.76 KB
/
react-native-ts.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
module.exports = {
root: true,
env: {
jest: true,
browser: true,
'react-native/react-native': true,
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
alias: {
map: [['~', './src']],
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
version: 'detect',
},
parser: '@typescript-eslint/parser',
extends: [
'standard',
'standard-react',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jsx-a11y/recommended',
'prettier',
'@react-native-community',
],
plugins: [
'@typescript-eslint',
'prettier',
'import',
'react',
'react-hooks',
'testing-library',
'jest',
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.json',
tsconfigRootDir: './',
createDefaultProgram: true,
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-empty-function': 'off',
'space-infix-ops': 'off',
'@typescript-eslint/space-infix-ops': ['warn', { int32Hint: false }],
'brace-style': ['error', '1tbs'],
curly: ['error', 'all'],
'default-param-last': 'off',
'no-shadow': 'off',
'comma-dangle': 'off',
'import/prefer-default-export': 'off',
'react-native/no-unused-styles': 'error',
'react-native/split-platform-components': 'warn',
'react-native/no-inline-styles': 'warn',
'react-native/no-color-literals': 'warn',
'react-native/no-single-element-style-arrays': 'warn',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/order': [
'warn',
{
alphabetize: {
order: 'asc',
caseInsensitive: false,
},
groups: [['builtin'], ['external', 'internal'], ['parent'], ['sibling', 'index']],
'newlines-between': 'always',
pathGroups: [
{
pattern: '~/**',
group: 'parent',
},
],
},
],
indent: 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-quotes': ['error', 'prefer-double'],
'array-callback-return': ['error', { allowImplicit: true }],
'default-case': ['error', { commentPattern: '^no default$' }],
'default-case-last': 'off',
'dot-notation': ['error', { allowKeywords: true }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-plusplus': 0,
'no-trailing-spaces': 'error',
'no-use-before-define': 'off',
'no-return-await': 'error',
'max-classes-per-file': ['error', 1],
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/destructuring-assignment': 'error',
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.tsx', '.ts'] }],
'react/jsx-handler-names': 'off',
'react/jsx-indent': ['error', 2],
'react/jsx-indent-props': ['error', 2],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
'react/no-deprecated': ['error'],
'react/no-string-refs': 'error',
'react/self-closing-comp': 'error',
'node/handle-callback-err': 'warn',
semi: ['error', 'always'],
'sort-imports': ['error', { ignoreDeclarationSort: true, ignoreCase: true }],
'sort-vars': ['error', { ignoreCase: true }],
},
};