Skip to content

Commit e32cdbc

Browse files
Merge pull request #947 from GetStream/khushal87-fix-lint-warnings
fix: lint warnings in the SDK and example apps
2 parents 17ad925 + 9458350 commit e32cdbc

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
lines changed

examples/SampleApp/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"no-mixed-spaces-and-tabs": 1,
141141
"no-self-compare": 2,
142142
"no-underscore-dangle": [2, { "allowAfterThis": true }],
143-
"no-unused-vars": [1, { "ignoreRestSiblings": true }],
143+
"no-unused-vars": [1, { "ignoreRestSiblings": true, "args":"none" }],
144144
"no-useless-concat": 2,
145145
"no-var": 2,
146146
"object-shorthand": 1,

examples/SampleApp/src/components/ChatScreenHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react';
2-
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
2+
import { Image, StyleSheet, TouchableOpacity } from 'react-native';
33
import { CompositeNavigationProp, useNavigation } from '@react-navigation/native';
44
import { useChatContext, useTheme } from 'stream-chat-react-native';
55

examples/SampleApp/src/hooks/useChatClient.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import type {
1515
LoginConfig,
1616
} from '../types';
1717

18-
const getRandomInt = (min: number, max: number) => Math.floor(Math.random() * (max - min)) + min;
19-
2018
export const useChatClient = () => {
2119
const [chatClient, setChatClient] = useState<StreamChat<
2220
LocalAttachmentType,
@@ -41,7 +39,6 @@ export const useChatClient = () => {
4139
>(config.apiKey, {
4240
timeout: 6000,
4341
});
44-
const randomSeed = getRandomInt(1, 50);
4542
const user = {
4643
id: config.userId,
4744
image: config.userImage,

examples/SampleApp/src/icons/Close.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTheme } from 'stream-chat-react-native';
44

55
import { IconProps } from '../utils/base';
66

7-
export const Close: React.FC<IconProps> = ({ active, height, width }) => {
7+
export const Close: React.FC<IconProps> = ({ height, width }) => {
88
const {
99
theme: {
1010
colors: { black },

examples/SampleApp/src/icons/RightArrow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTheme } from 'stream-chat-react-native';
44

55
import { IconProps } from '../utils/base';
66

7-
export const RightArrow: React.FC<IconProps> = ({ active, height, width }) => {
7+
export const RightArrow: React.FC<IconProps> = ({ height, width }) => {
88
const {
99
theme: {
1010
colors: { accent_blue },

examples/SampleApp/src/screens/NewDirectMessagingScreen.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
2-
import { Alert, Platform, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
1+
import React, { useContext, useEffect, useRef, useState } from 'react';
2+
import { Platform, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
33
import { SafeAreaView } from 'react-native-safe-area-context';
44
import {
55
Channel,
66
Group,
77
MessageInput,
88
MessageList,
9-
SendButton,
10-
SendButtonProps,
119
User,
1210
UserAdd,
1311
useTheme,
@@ -163,7 +161,8 @@ export const NewDirectMessagingScreen: React.FC<NewDirectMessagingScreenProps> =
163161

164162
const [focusOnMessageInput, setFocusOnMessageInput] = useState(false);
165163
const [focusOnSearchInput, setFocusOnSearchInput] = useState(true);
166-
const [messageInputText, setMessageInputText] = useState('');
164+
// As we don't use the state value, we can omit it here and separate it with a comma within the array.
165+
const [, setMessageInputText] = useState('');
167166

168167
// When selectedUsers are changed, initiate a channel with those users as members,
169168
// and set it as a channel on current screen.

0 commit comments

Comments
 (0)