react-native-gifted-chat 2.4.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +34 -14
  2. package/lib/Actions.d.ts +5 -6
  3. package/lib/Actions.js +16 -13
  4. package/lib/Actions.js.map +1 -1
  5. package/lib/Avatar.d.ts +9 -25
  6. package/lib/Avatar.js +12 -18
  7. package/lib/Avatar.js.flow +1 -1
  8. package/lib/Avatar.js.map +1 -1
  9. package/lib/Bubble.d.ts +29 -30
  10. package/lib/Bubble.js +99 -92
  11. package/lib/Bubble.js.flow +2 -2
  12. package/lib/Bubble.js.map +1 -1
  13. package/lib/Composer.d.ts +1 -1
  14. package/lib/Composer.js +30 -32
  15. package/lib/Composer.js.map +1 -1
  16. package/lib/Constant.js +1 -0
  17. package/lib/Constant.js.map +1 -1
  18. package/lib/Day.d.ts +3 -15
  19. package/lib/Day.js +2 -14
  20. package/lib/Day.js.flow +1 -1
  21. package/lib/Day.js.map +1 -1
  22. package/lib/GiftedAvatar.d.ts +7 -7
  23. package/lib/GiftedAvatar.js +30 -29
  24. package/lib/GiftedAvatar.js.map +1 -1
  25. package/lib/GiftedChat.d.ts +15 -89
  26. package/lib/GiftedChat.js +204 -350
  27. package/lib/GiftedChat.js.flow +1 -3
  28. package/lib/GiftedChat.js.map +1 -1
  29. package/lib/GiftedChatContext.d.ts +2 -1
  30. package/lib/GiftedChatContext.js.map +1 -1
  31. package/lib/InputToolbar.d.ts +7 -5
  32. package/lib/InputToolbar.js +41 -34
  33. package/lib/InputToolbar.js.map +1 -1
  34. package/lib/LoadEarlier.d.ts +4 -4
  35. package/lib/LoadEarlier.js +8 -6
  36. package/lib/LoadEarlier.js.map +1 -1
  37. package/lib/Message.d.ts +8 -9
  38. package/lib/Message.js +47 -40
  39. package/lib/Message.js.flow +1 -1
  40. package/lib/Message.js.map +1 -1
  41. package/lib/MessageAudio.d.ts +2 -1
  42. package/lib/MessageAudio.js +4 -4
  43. package/lib/MessageAudio.js.flow +1 -1
  44. package/lib/MessageAudio.js.map +1 -1
  45. package/lib/MessageContainer.d.ts +17 -17
  46. package/lib/MessageContainer.js +33 -51
  47. package/lib/MessageContainer.js.map +1 -1
  48. package/lib/MessageImage.d.ts +5 -4
  49. package/lib/MessageImage.js +4 -5
  50. package/lib/MessageImage.js.flow +1 -1
  51. package/lib/MessageImage.js.map +1 -1
  52. package/lib/MessageText.d.ts +11 -10
  53. package/lib/MessageText.js +5 -10
  54. package/lib/MessageText.js.flow +1 -1
  55. package/lib/MessageText.js.map +1 -1
  56. package/lib/MessageVideo.d.ts +2 -1
  57. package/lib/MessageVideo.js +4 -4
  58. package/lib/MessageVideo.js.flow +1 -1
  59. package/lib/MessageVideo.js.map +1 -1
  60. package/lib/Models.d.ts +7 -7
  61. package/lib/QuickReplies.d.ts +3 -3
  62. package/lib/QuickReplies.js +8 -14
  63. package/lib/QuickReplies.js.flow +1 -1
  64. package/lib/QuickReplies.js.map +1 -1
  65. package/lib/Send.d.ts +4 -4
  66. package/lib/Send.js +6 -9
  67. package/lib/Send.js.map +1 -1
  68. package/lib/SystemMessage.d.ts +6 -5
  69. package/lib/SystemMessage.js +1 -2
  70. package/lib/SystemMessage.js.flow +1 -1
  71. package/lib/SystemMessage.js.map +1 -1
  72. package/lib/Time.d.ts +7 -6
  73. package/lib/Time.js +1 -3
  74. package/lib/Time.js.flow +1 -1
  75. package/lib/Time.js.map +1 -1
  76. package/lib/TypingIndicator.d.ts +2 -1
  77. package/lib/TypingIndicator.js +5 -5
  78. package/lib/TypingIndicator.js.map +1 -1
  79. package/lib/hooks/useUpdateLayoutEffect.js +2 -4
  80. package/lib/hooks/useUpdateLayoutEffect.js.map +1 -1
  81. package/lib/index.d.ts +1 -0
  82. package/lib/index.js +1 -0
  83. package/lib/index.js.map +1 -1
  84. package/lib/logging.d.ts +2 -2
  85. package/lib/logging.js.map +1 -1
  86. package/lib/types.js.flow +1 -1
  87. package/lib/utils.d.ts +1 -1
  88. package/lib/utils.js +2 -4
  89. package/lib/utils.js.map +1 -1
  90. package/package.json +86 -59
  91. package/src/Actions.tsx +114 -0
  92. package/src/Avatar.tsx +178 -0
  93. package/src/Bubble.tsx +596 -0
  94. package/src/Color.ts +17 -0
  95. package/src/Composer.tsx +147 -0
  96. package/src/Constant.ts +18 -0
  97. package/src/Day.tsx +71 -0
  98. package/src/GiftedAvatar.tsx +205 -0
  99. package/src/GiftedChat.tsx +670 -0
  100. package/src/GiftedChatContext.ts +23 -0
  101. package/src/InputToolbar.tsx +113 -0
  102. package/src/LoadEarlier.tsx +108 -0
  103. package/src/Message.tsx +229 -0
  104. package/src/MessageAudio.tsx +19 -0
  105. package/src/MessageContainer.tsx +362 -0
  106. package/src/MessageImage.tsx +78 -0
  107. package/src/MessageText.tsx +187 -0
  108. package/src/MessageVideo.tsx +19 -0
  109. package/src/Models.ts +84 -0
  110. package/src/QuickReplies.tsx +186 -0
  111. package/src/Send.tsx +102 -0
  112. package/src/SystemMessage.tsx +61 -0
  113. package/src/Time.tsx +97 -0
  114. package/src/TypingIndicator.tsx +108 -0
  115. package/src/__tests__/Actions.test.tsx +10 -0
  116. package/src/__tests__/Avatar.test.tsx +13 -0
  117. package/src/__tests__/Bubble.test.tsx +23 -0
  118. package/src/__tests__/Color.test.tsx +5 -0
  119. package/src/__tests__/Composer.test.tsx +11 -0
  120. package/src/__tests__/Constant.test.tsx +5 -0
  121. package/src/__tests__/Day.test.tsx +23 -0
  122. package/src/__tests__/GiftedAvatar.test.tsx +11 -0
  123. package/src/__tests__/GiftedChat.test.tsx +36 -0
  124. package/src/__tests__/InputToolbar.test.tsx +11 -0
  125. package/src/__tests__/LoadEarlier.test.tsx +11 -0
  126. package/src/__tests__/Message.test.tsx +77 -0
  127. package/src/__tests__/MessageContainer.test.tsx +11 -0
  128. package/src/__tests__/MessageImage.test.tsx +27 -0
  129. package/src/__tests__/MessageText.test.tsx +11 -0
  130. package/src/__tests__/Send.test.tsx +22 -0
  131. package/src/__tests__/SystemMessage.test.tsx +27 -0
  132. package/src/__tests__/Time.test.tsx +29 -0
  133. package/src/__tests__/__snapshots__/Actions.test.tsx.snap +76 -0
  134. package/src/__tests__/__snapshots__/Avatar.test.tsx.snap +17 -0
  135. package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +145 -0
  136. package/src/__tests__/__snapshots__/Color.test.tsx.snap +21 -0
  137. package/src/__tests__/__snapshots__/Composer.test.tsx.snap +35 -0
  138. package/src/__tests__/__snapshots__/Constant.test.tsx.snap +16 -0
  139. package/src/__tests__/__snapshots__/Day.test.tsx.snap +37 -0
  140. package/src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap +22 -0
  141. package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +15 -0
  142. package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +60 -0
  143. package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +74 -0
  144. package/src/__tests__/__snapshots__/Message.test.tsx.snap +628 -0
  145. package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +127 -0
  146. package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +38 -0
  147. package/src/__tests__/__snapshots__/MessageText.test.tsx.snap +30 -0
  148. package/src/__tests__/__snapshots__/Send.test.tsx.snap +129 -0
  149. package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +38 -0
  150. package/src/__tests__/__snapshots__/Time.test.tsx.snap +33 -0
  151. package/src/__tests__/data.ts +8 -0
  152. package/src/__tests__/utils.test.ts +31 -0
  153. package/src/hooks/useUpdateLayoutEffect.ts +21 -0
  154. package/src/index.ts +4 -0
  155. package/src/logging.ts +8 -0
  156. package/src/utils.ts +39 -0
  157. package/.eslintignore +0 -2
  158. package/.eslintrc.js +0 -21
  159. package/jest.config.js +0 -15
@@ -0,0 +1,127 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`should render <MessageContainer /> and compare with snapshot 1`] = `
4
+ <View
5
+ style={
6
+ {
7
+ "flex": 1,
8
+ }
9
+ }
10
+ >
11
+ <RCTScrollView
12
+ ListEmptyComponent={[Function]}
13
+ ListFooterComponent={[Function]}
14
+ ListHeaderComponent={[Function]}
15
+ automaticallyAdjustContentInsets={false}
16
+ contentContainerStyle={
17
+ {
18
+ "flexGrow": 1,
19
+ "justifyContent": "flex-start",
20
+ }
21
+ }
22
+ data={[]}
23
+ extraData={
24
+ [
25
+ null,
26
+ false,
27
+ ]
28
+ }
29
+ getItem={[Function]}
30
+ getItemCount={[Function]}
31
+ invertStickyHeaders={true}
32
+ inverted={true}
33
+ isInvertedVirtualizedList={true}
34
+ keyExtractor={[Function]}
35
+ onContentSizeChange={[Function]}
36
+ onEndReached={[Function]}
37
+ onEndReachedThreshold={0.1}
38
+ onLayout={[Function]}
39
+ onMomentumScrollBegin={[Function]}
40
+ onMomentumScrollEnd={[Function]}
41
+ onScroll={[Function]}
42
+ onScrollBeginDrag={[Function]}
43
+ onScrollEndDrag={[Function]}
44
+ removeClippedSubviews={false}
45
+ renderItem={[Function]}
46
+ scrollEventThrottle={100}
47
+ stickyHeaderIndices={[]}
48
+ style={
49
+ [
50
+ {
51
+ "transform": [
52
+ {
53
+ "scaleY": -1,
54
+ },
55
+ ],
56
+ },
57
+ {
58
+ "flex": 1,
59
+ },
60
+ ]
61
+ }
62
+ viewabilityConfigCallbackPairs={[]}
63
+ >
64
+ <View>
65
+ <View
66
+ collapsable={false}
67
+ onLayout={[Function]}
68
+ style={
69
+ {
70
+ "transform": [
71
+ {
72
+ "scaleY": -1,
73
+ },
74
+ ],
75
+ }
76
+ }
77
+ >
78
+ <View
79
+ collapsable={false}
80
+ style={
81
+ {
82
+ "backgroundColor": "#f0f0f0",
83
+ "borderRadius": 15,
84
+ "height": 0,
85
+ "marginBottom": 0,
86
+ "marginLeft": 8,
87
+ "transform": [
88
+ {
89
+ "translateY": 200,
90
+ },
91
+ ],
92
+ "width": 45,
93
+ }
94
+ }
95
+ />
96
+ </View>
97
+ <View
98
+ style={
99
+ {
100
+ "flex": 1,
101
+ }
102
+ }
103
+ />
104
+ <View
105
+ onLayout={[Function]}
106
+ style={
107
+ {
108
+ "transform": [
109
+ {
110
+ "scaleY": -1,
111
+ },
112
+ ],
113
+ }
114
+ }
115
+ >
116
+ <View
117
+ style={
118
+ {
119
+ "flex": 1,
120
+ }
121
+ }
122
+ />
123
+ </View>
124
+ </View>
125
+ </RCTScrollView>
126
+ </View>
127
+ `;
@@ -0,0 +1,38 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`MessageImage should render <MessageImage /> and compare with snapshot 1`] = `
4
+ <View>
5
+ <Lightbox
6
+ activeProps={
7
+ {
8
+ "style": {
9
+ "flex": 1,
10
+ "resizeMode": "contain",
11
+ },
12
+ }
13
+ }
14
+ >
15
+ <Image
16
+ source={
17
+ {
18
+ "uri": "url://to/image.png",
19
+ }
20
+ }
21
+ style={
22
+ [
23
+ {
24
+ "borderRadius": 13,
25
+ "height": 100,
26
+ "margin": 3,
27
+ "resizeMode": "cover",
28
+ "width": 150,
29
+ },
30
+ undefined,
31
+ ]
32
+ }
33
+ />
34
+ </Lightbox>
35
+ </View>
36
+ `;
37
+
38
+ exports[`MessageImage should not render <MessageImage /> and compare with snapshot 1`] = `null`;
@@ -0,0 +1,30 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`should render <MessageText /> and compare with snapshot 1`] = `
4
+ <View
5
+ style={
6
+ [
7
+ {},
8
+ undefined,
9
+ ]
10
+ }
11
+ >
12
+ <Text
13
+ style={
14
+ [
15
+ {
16
+ "color": "black",
17
+ "fontSize": 16,
18
+ "lineHeight": 20,
19
+ "marginBottom": 5,
20
+ "marginLeft": 10,
21
+ "marginRight": 10,
22
+ "marginTop": 5,
23
+ },
24
+ undefined,
25
+ undefined,
26
+ ]
27
+ }
28
+ />
29
+ </View>
30
+ `;
@@ -0,0 +1,129 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Send should always render <Send /> and compare with snapshot 1`] = `
4
+ <View
5
+ accessibilityLabel="send"
6
+ accessibilityRole="button"
7
+ accessibilityState={
8
+ {
9
+ "busy": undefined,
10
+ "checked": undefined,
11
+ "disabled": false,
12
+ "expanded": undefined,
13
+ "selected": undefined,
14
+ }
15
+ }
16
+ accessibilityValue={
17
+ {
18
+ "max": undefined,
19
+ "min": undefined,
20
+ "now": undefined,
21
+ "text": undefined,
22
+ }
23
+ }
24
+ accessible={true}
25
+ collapsable={false}
26
+ focusable={true}
27
+ onClick={[Function]}
28
+ onResponderGrant={[Function]}
29
+ onResponderMove={[Function]}
30
+ onResponderRelease={[Function]}
31
+ onResponderTerminate={[Function]}
32
+ onResponderTerminationRequest={[Function]}
33
+ onStartShouldSetResponder={[Function]}
34
+ style={
35
+ {
36
+ "height": 44,
37
+ "justifyContent": "flex-end",
38
+ "opacity": 1,
39
+ }
40
+ }
41
+ testID="GC_SEND_TOUCHABLE"
42
+ >
43
+ <View>
44
+ <Text
45
+ style={
46
+ [
47
+ {
48
+ "backgroundColor": "transparent",
49
+ "color": "#0084ff",
50
+ "fontSize": 17,
51
+ "fontWeight": "600",
52
+ "marginBottom": 12,
53
+ "marginLeft": 10,
54
+ "marginRight": 10,
55
+ },
56
+ undefined,
57
+ ]
58
+ }
59
+ >
60
+ Send
61
+ </Text>
62
+ </View>
63
+ </View>
64
+ `;
65
+
66
+ exports[`Send should not render <Send /> and compare with snapshot 1`] = `null`;
67
+
68
+ exports[`Send should render <Send /> where there is input and compare with snapshot 1`] = `
69
+ <View
70
+ accessibilityLabel="send"
71
+ accessibilityRole="button"
72
+ accessibilityState={
73
+ {
74
+ "busy": undefined,
75
+ "checked": undefined,
76
+ "disabled": false,
77
+ "expanded": undefined,
78
+ "selected": undefined,
79
+ }
80
+ }
81
+ accessibilityValue={
82
+ {
83
+ "max": undefined,
84
+ "min": undefined,
85
+ "now": undefined,
86
+ "text": undefined,
87
+ }
88
+ }
89
+ accessible={true}
90
+ collapsable={false}
91
+ focusable={true}
92
+ onClick={[Function]}
93
+ onResponderGrant={[Function]}
94
+ onResponderMove={[Function]}
95
+ onResponderRelease={[Function]}
96
+ onResponderTerminate={[Function]}
97
+ onResponderTerminationRequest={[Function]}
98
+ onStartShouldSetResponder={[Function]}
99
+ style={
100
+ {
101
+ "height": 44,
102
+ "justifyContent": "flex-end",
103
+ "opacity": 1,
104
+ }
105
+ }
106
+ testID="GC_SEND_TOUCHABLE"
107
+ >
108
+ <View>
109
+ <Text
110
+ style={
111
+ [
112
+ {
113
+ "backgroundColor": "transparent",
114
+ "color": "#0084ff",
115
+ "fontSize": 17,
116
+ "fontWeight": "600",
117
+ "marginBottom": 12,
118
+ "marginLeft": 10,
119
+ "marginRight": 10,
120
+ },
121
+ undefined,
122
+ ]
123
+ }
124
+ >
125
+ Send
126
+ </Text>
127
+ </View>
128
+ </View>
129
+ `;
@@ -0,0 +1,38 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`SystemMessage should not render <SystemMessage /> and compare with snapshot 1`] = `null`;
4
+
5
+ exports[`SystemMessage should render <SystemMessage /> and compare with snapshot 1`] = `
6
+ <View
7
+ style={
8
+ [
9
+ {
10
+ "alignItems": "center",
11
+ "flex": 1,
12
+ "justifyContent": "center",
13
+ "marginBottom": 10,
14
+ "marginTop": 5,
15
+ },
16
+ undefined,
17
+ ]
18
+ }
19
+ >
20
+ <View>
21
+ <Text
22
+ style={
23
+ [
24
+ {
25
+ "backgroundColor": "transparent",
26
+ "color": "#b2b2b2",
27
+ "fontSize": 12,
28
+ "fontWeight": "300",
29
+ },
30
+ undefined,
31
+ ]
32
+ }
33
+ >
34
+ test
35
+ </Text>
36
+ </View>
37
+ </View>
38
+ `;
@@ -0,0 +1,33 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Time should not render <Time /> and compare with snapshot 1`] = `null`;
4
+
5
+ exports[`Time should render <Time /> and compare with snapshot 1`] = `
6
+ <View
7
+ style={
8
+ [
9
+ {
10
+ "marginBottom": 5,
11
+ "marginLeft": 10,
12
+ "marginRight": 10,
13
+ },
14
+ undefined,
15
+ ]
16
+ }
17
+ >
18
+ <Text
19
+ style={
20
+ [
21
+ {
22
+ "color": "#aaa",
23
+ "fontSize": 10,
24
+ "textAlign": "right",
25
+ },
26
+ undefined,
27
+ ]
28
+ }
29
+ >
30
+ 10:05 AM
31
+ </Text>
32
+ </View>
33
+ `;
@@ -0,0 +1,8 @@
1
+ import { IMessage } from '../Models'
2
+
3
+ export const DEFAULT_TEST_MESSAGE: IMessage = {
4
+ _id: 'test',
5
+ text: 'test',
6
+ user: { _id: 'test' },
7
+ createdAt: new Date(2022, 3, 17),
8
+ }
@@ -0,0 +1,31 @@
1
+ import { isSameDay, isSameUser } from '../utils'
2
+
3
+ it('should test if same day', () => {
4
+ const now = new Date()
5
+ expect(
6
+ isSameDay(
7
+ {
8
+ _id: 1,
9
+ text: 'test',
10
+ createdAt: now,
11
+ user: { _id: 1 },
12
+ },
13
+ {
14
+ _id: 2,
15
+ text: 'test2',
16
+ createdAt: now,
17
+ user: { _id: 2 },
18
+ }
19
+ )
20
+ ).toBe(true)
21
+ })
22
+
23
+ it('should test if same user', () => {
24
+ const message = {
25
+ _id: 1,
26
+ text: 'test',
27
+ createdAt: new Date(),
28
+ user: { _id: 1 },
29
+ }
30
+ expect(isSameUser(message, message)).toBe(true)
31
+ })
@@ -0,0 +1,21 @@
1
+ import { DependencyList, useLayoutEffect, useRef } from 'react'
2
+
3
+ /**
4
+ * A custom useEffect hook that only triggers on updates, not on initial mount
5
+ * Idea stolen from: https://stackoverflow.com/a/55075818/1526448
6
+ * @param {()=>void} effect the function to call
7
+ * @param {DependencyList} dependencies the state(s) that fires the update
8
+ */
9
+ export function useUpdateLayoutEffect (
10
+ effect: () => void,
11
+ dependencies: DependencyList = []
12
+ ) {
13
+ const isInitialMount = useRef(true)
14
+
15
+ useLayoutEffect(() => {
16
+ if (isInitialMount.current)
17
+ isInitialMount.current = false
18
+ else
19
+ effect()
20
+ }, dependencies)
21
+ }
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from './GiftedChat'
2
+ export * from './Constant'
3
+ export * from './utils'
4
+ export * from './GiftedChatContext'
package/src/logging.ts ADDED
@@ -0,0 +1,8 @@
1
+ const styleString = (color: string) => `color: ${color}; font-weight: bold`
2
+ const headerLog = '%c[react-native-gifted-chat]'
3
+
4
+ export const warning = (...args: unknown[]) =>
5
+ console.log(headerLog, styleString('orange'), ...args)
6
+
7
+ export const error = (...args: unknown[]) =>
8
+ console.log(headerLog, styleString('red'), ...args)
package/src/utils.ts ADDED
@@ -0,0 +1,39 @@
1
+ import PropTypes from 'prop-types'
2
+ import dayjs from 'dayjs'
3
+
4
+ import { IMessage } from './Models'
5
+
6
+ export const StylePropType = PropTypes.oneOfType([
7
+ PropTypes.array,
8
+ PropTypes.object,
9
+ PropTypes.number,
10
+ PropTypes.bool,
11
+ ])
12
+
13
+ export function isSameDay (
14
+ currentMessage: IMessage,
15
+ diffMessage: IMessage | null | undefined
16
+ ) {
17
+ if (!diffMessage || !diffMessage.createdAt)
18
+ return false
19
+
20
+ const currentCreatedAt = dayjs(currentMessage.createdAt)
21
+ const diffCreatedAt = dayjs(diffMessage.createdAt)
22
+
23
+ if (!currentCreatedAt.isValid() || !diffCreatedAt.isValid())
24
+ return false
25
+
26
+ return currentCreatedAt.isSame(diffCreatedAt, 'day')
27
+ }
28
+
29
+ export function isSameUser (
30
+ currentMessage: IMessage,
31
+ diffMessage: IMessage | null | undefined
32
+ ) {
33
+ return !!(
34
+ diffMessage &&
35
+ diffMessage.user &&
36
+ currentMessage.user &&
37
+ diffMessage.user._id === currentMessage.user._id
38
+ )
39
+ }
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
-
2
- example/*
package/.eslintrc.js DELETED
@@ -1,21 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- node: true,
5
- },
6
- parser: '@typescript-eslint/parser',
7
- plugins: ['@typescript-eslint'],
8
- // extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
9
- rules: {
10
- 'member-access': 0,
11
- 'interface-name': 0,
12
- 'ordered-imports': 0,
13
- 'object-literal-sort-keys': 0,
14
- 'variable-name': 0,
15
- 'one-variable-per-declaration': 0,
16
- 'no-empty': 0,
17
- 'no-console': 0,
18
- 'no-shadowed-variable': 0,
19
- 'no-extra-boolean-cast': 0,
20
- },
21
- }
package/jest.config.js DELETED
@@ -1,15 +0,0 @@
1
- module.exports = {
2
- preset: 'react-native',
3
- setupFiles: ['<rootDir>/tests/setup.js'],
4
- moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'],
5
- transform: {
6
- '^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
7
- // '^.+\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
8
- },
9
- transformIgnorePatterns: [
10
- '/node_modules/(?!(@react-native|react-native)).*/',
11
- ],
12
- testMatch: ['**/*.test.ts?(x)'],
13
- modulePathIgnorePatterns: ['<rootDir>/example'],
14
- coveragePathIgnorePatterns: ['./src/__tests__/'],
15
- }