-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path.eslintrc.js
60 lines (60 loc) · 1.65 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
module.exports = {
root: true,
env: {
es6: true,
jest: true,
'react-native/react-native': true,
},
parser: '@typescript-eslint/parser',
plugins: [
'react-hooks',
'testing-library',
'jest',
'react',
'react-native',
'import',
'promise',
'react-native-a11y',
],
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended',
],
parserOptions: {
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
rules: {
'@typescript-eslint/no-use-before-define': ['off'],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'no-console': ['error', {allow: ['warn']}],
'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-raw-text': 'error',
'react-native/no-single-element-style-arrays': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-disabled-tests': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
'no-restricted-imports': [
'error',
{
name: 'react-redux',
importNames: ['useSelector', 'useDispatch'],
message: 'use hooks in `src/hooks/useSelector` for typing support',
},
],
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {},
},
],
ignorePatterns: ['**/node_modules/**'],
};