-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.eslintrc.js
More file actions
140 lines (135 loc) · 3.98 KB
/
.eslintrc.js
File metadata and controls
140 lines (135 loc) · 3.98 KB
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
const error = 'error'
module.exports = {
root: true,
ignorePatterns: [
'commitlint.config.js',
'generated.ts',
],
'extends': [
'@react-native-community',
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react-native/all',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
project: 'tsconfig.json',
tsconfigRootDir: '.',
createDefaultProgram: true,
},
plugins: ['@typescript-eslint', 'react', 'unused-imports'],
rules: {
'unused-imports/no-unused-imports': 'error',
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
camelcase: 0,
curly: [error, 'all'],
complexity: [error, { max: 6 }],
'lines-between-class-members': 0,
'max-nested-callbacks': [error, 4],
'max-len': [error, 120],
'member-access': 0,
'no-irregular-whitespace': 2,
'no-duplicate-imports': error,
'only-arrow-functions': 0,
quotes: [error, 'single', { avoidEscape: true }],
semi: [error, 'never'],
'space-before-function-paren': [
error,
{
anonymous: 'always',
asyncArrow: 'always',
named: 'never',
},
],
eqeqeq: [error, 'always', { 'null': 'ignore' }],
'quote-props': [error, 'as-needed', { keywords: true }],
'react-native/sort-styles': 0,
'class-methods-use-this': 0,
'import/prefer-default-export': 0,
'import/extensions': [
error,
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
jpg: 'never',
},
],
'import/order': [
error,
{
groups: [
'builtin',
'external',
'parent',
'sibling',
'index',
'internal',
'object',
'type',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc', /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */
caseInsensitive: true, /* ignore case. Options: [true, false] */
},
},
],
'max-classes-per-file': 0,
'no-else-return': 0,
'no-underscore-dangle': 0,
'no-plusplus': 0,
'no-nested-ternary': 0,
'implicit-arrow-linebreak': 0,
'no-unreachable': 1,
'no-param-reassign': 1,
'no-use-before-define': 0,
'react/jsx-no-literals': error,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-use-before-define': [2, { variables: false }],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/member-delimiter-style': [error, {
multiline: {
delimiter: 'comma', // 'none' or 'semi' or 'comma'
requireLast: true,
},
singleline: {
delimiter: 'comma', // 'semi' or 'comma'
requireLast: true,
},
}],
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/ban-ts-comment': 0,
// note you must disable the base rule as it can report incorrect errors
'no-shadow': 'off',
'ban-ts-ignore': 0,
'ban-ts-comment': 0,
'operator-linebreak': [error, 'before'],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'block-like', next: 'block-like' },
],
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
}