generated from bratislava/expo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
59 lines (59 loc) · 2.67 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
module.exports = {
extends: ['auto'],
ignorePatterns: [
'*.config.*',
'.eslintrc.js',
'modules/backend/openapi-generated',
'modules/backend/utils/fix-client.js',
],
rules: {
'@typescript-eslint/no-use-before-define': ['error', { variables: false }],
/** We use this a lot with isDefined and hasAttributes */
'unicorn/no-array-callback-reference': 'off',
// Named export is easier to refactor automatically
'import/prefer-default-export': 'off',
'@typescript-eslint/no-shadow': ['error', { allow: ['event', 'value', 'key', 'error'] }],
/** Too tedious to type every function return explicitly */
'@typescript-eslint/explicit-function-return-type': 'off',
/** We prefer arrow functions */
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
/** e.g. Keeps return statement in short arrow functions */
'arrow-body-style': 'off',
/** Links get confused for secrets */
/** Turned off completely because of several false positives */
'no-secrets/no-secrets': ['off', { ignoreContent: 'http' }],
/** Very hard to maintain, especially with other libs not respecting this */
'@typescript-eslint/no-unsafe-assignment': 'off',
/** To remove optional parameter warning e.g. { page?: number } */
'react/require-default-props': 'off',
/** Include Typography as allowed text component */
'react-native/no-raw-text': ['error', { skip: ['Typography', 'Button'] }],
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'switch-case/newline-between-switch-case': 'off',
// Solve warning "Promise-returning function provided to attribute where a void return was expected."
'@typescript-eslint/no-misused-promises': [
'warn',
{
checksVoidReturn: {
attributes: false,
},
},
],
/** if comparing values in cx function or creating translations, it"s overkill to create variables for that */
'sonarjs/no-duplicate-string': 'warn',
// quite annoying as it conflicts with VS Code"s auto import
'lodash/import-scope': 'off',
/* solves error with imports from files with no extension */
'import/extensions': 'off',
'react/react-in-jsx-scope': 'off',
// cumbersome when prototyping
'react-native/no-color-literals': 'off',
// too many false positives
'pii/no-phone-number': 'off',
// Not relevant to force separation of styles, when we use nativewind
'react-native/no-inline-styles': 'off',
'padding-line-between-statements': ['warn', { blankLine: 'always', prev: '*', next: 'return' }],
'@typescript-eslint/no-floating-promises': 'warn',
'const-case/uppercase': 'off',
},
}