This repository has been archived by the owner on Dec 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.eslintrc.js
61 lines (61 loc) · 2.3 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['@react-native-community', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['@typescript-eslint', 'prettier', 'testing-library'],
rules: {
'no-restricted-imports': [
2,
{
paths: [
{
name: 'react-native',
importNames: ['SafeAreaView'],
message:
'Using SafeAreaView from RN may result in buggy appearance, use react-native-safe-area-context instead.',
},
{
name: '@polkadot/util',
importNames: ['formatBalance'],
message: 'Please use useFormatBalance hook instead.',
},
{
name: 'react-native-paper',
importNames: ['useTheme'],
message: 'Please import useTheme from @ui/library instead.',
},
{
name: '@react-navigation/native',
importNames: ['useTheme'],
message: 'Please import useTheme from @ui/library instead.',
},
{
name: '@ui/library',
importNames: ['Snackbar'],
message: 'Please use useSnackbar from context/SnackbarContext instead.',
},
{
name: '@testing-library/react-native',
message: 'Please use src/testUtils instead',
},
{
name: '@polkadot/util-crypto',
message: 'Please use @polkadotApi/useCryptoUtil instead.',
},
],
},
],
'react/no-unstable-nested-components': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'testing-library/await-async-query': 'error',
'testing-library/no-await-sync-query': 'error',
'testing-library/no-debugging-utils': 'warn',
'testing-library/prefer-screen-queries': 'off', // there is no screen object so this rule shouldn't be used
'testing-library/prefer-user-event': 'off', // not available for react-native
'testing-library/prefer-wait-for': 'off', // the wait utility is no longer available
'testing-library/no-wait-for-empty-callback': 'off', // waitFor callback param is no longer optional
},
};