-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
102 lines (102 loc) · 2.57 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
91
92
93
94
95
96
97
98
99
100
101
102
module.exports = {
env: {
es6: true,
node: true,
jest: true,
},
extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'airbnb-typescript/base',
'standard-with-typescript',
'prettier',
],
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'eslint-plugin-prettier',
'simple-import-sort',
],
parserOptions: {
parser: '@typescript-eslint/parser',
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
rules: {
'no-console': [
2,
{
allow: ['warn', 'error'],
},
],
indent: ['error', 2, {SwitchCase: 1}],
quotes: ['error', 'single', {avoidEscape: true}],
'react/prop-types': 'off',
'no-unused-vars': 2,
'no-param-reassign': 2,
'no-restricted-imports': 2,
'no-use-before-define': 0,
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 0,
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
// simple-import-sort
'sort-imports': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
// 1. Side effect imports
['^\\u0000'],
// 2. React and React Native imports
['^react$', '^react-native$', '^react/', '^react-native/'],
// 3. Any other 3rd party imports
['^@?\\w'],
// 4. Our modules, other than the module the current file is part of
[
'^@components?\\w',
'^@features?\\w',
'^@hooks?\\w',
'^@utils?\\w',
'^@navigation?\\w',
'^@localization?\\w',
'^@lib?\\w',
'^@services?\\w',
'^@theme?\\w',
],
// 5. Other parts of the same module that the current file is part of
['^\\.'],
// 6. Styles
['^\\./styles'],
// 7. Types
['^.*\\u0000$'],
],
},
],
'simple-import-sort/exports': 'error',
'import/no-extraneous-dependencies': ['error', {devDependencies: true}],
// 'react/function-component-definition': [
// 'error',
// {namedComponents: 'arrow-function'},
// ],
'react/display-name': ['error'],
},
};