-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
90 lines (90 loc) · 2.1 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
81
82
83
84
85
86
87
88
89
90
module.exports = {
root: true,
extends: [
'airbnb',
'airbnb/hooks',
'prettier',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'@react-native-community',
],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'react-hooks',
'unused-imports',
'detox',
'jest',
],
rules: {
// Semi-colons are un-needed
semi: 'off',
// Allow .tsx extensions
'react/jsx-filename-extension': [1, {extensions: ['.js', '.tsx']}],
// Spaces between class members don't look as good
'lines-between-class-members': 'off',
// Un-necessary rule
'react/jsx-props-no-spreading': 'off',
// Babel module resolver,
'import/no-unresolved': [
2,
{
ignore: [
'@assets',
'@components',
'@lib',
'@hooks',
'@i18n',
'@navigation',
'@services',
'@theme',
'@views',
'@models',
'@repositories',
],
},
],
// Don't explicitly add .tsx/.ts extensions
'import/extensions': [
2,
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
// Ensure correct ordering of imports
'import/order': [
2,
{
'newlines-between': 'never',
},
],
// Allows for auto-fixing of unused imports
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'off',
'unused-imports/no-unused-imports-ts': 2,
'unused-imports/no-unused-vars': 2,
// Prefer state as a class property
'react/state-in-constructor': 'off',
'react-hooks/exhaustive-deps': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': [
'error',
{devDependencies: ['**/*.story.tsx', 'storybook/*']},
],
'no-use-before-define': ['error', {variables: false}],
'no-useless-constructor': 'off',
'no-empty-function': [
'error',
{
allow: ['constructors'],
},
],
},
env: {
'jest/globals': true,
},
};