Skip to content

Commit dccdc01

Browse files
committed
fix lint
1 parent 4598273 commit dccdc01

File tree

76 files changed

+183
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+183
-165
lines changed

eslint.config.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default defineConfig([
144144
'import/no-default-export': 'off',
145145
},
146146
},
147-
// Allow default exports in route files (required by Expo Router)
147+
// Allow default exports and function declarations in route files (required by Expo Router)
148148
{
149149
name: 'routes-allow-default-export',
150150
files: [
@@ -159,6 +159,14 @@ export default defineConfig([
159159
'react/function-component-definition': 'off',
160160
},
161161
},
162+
// Allow function declaration for generic form components (arrow + generic is awkward in TSX)
163+
{
164+
name: 'form-components-allow-function',
165+
files: ['**/common/form/*.tsx'],
166+
rules: {
167+
'react/function-component-definition': 'off',
168+
},
169+
},
162170
// React 17+ and TypeScript specific overrides
163171
{
164172
name: 'react-typescript-overrides',
@@ -201,6 +209,7 @@ export default defineConfig([
201209
'@typescript-eslint/consistent-type-imports': 'off',
202210
'no-void': 'off',
203211
'no-restricted-globals': 'off',
212+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
204213
},
205214
},
206215
// Import / React structural

src/common/Container.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { StyleSheet, View } from 'react-native';
2+
23
import { COLORS } from 'theme';
34

45
import type { ReactElement, ReactNode } from 'react';

src/common/ErrorListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Props = LoaderErrorRowProps<{
2525
}>;
2626

2727
const ErrorListItem: FC<Props> = ({
28-
error: unusedError,
28+
error: _error,
2929
containerStyle,
3030
...otherProps
3131
}) => (

src/common/Header/HeaderIconButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { COLORS } from 'theme';
21
import { IconButton } from 'common/buttons/IconButton';
2+
import { COLORS } from 'theme';
33

44
import type { ComponentProps, FC, ReactElement } from 'react';
55

src/common/List.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type Props<TEntity> = ListProps<TEntity> & {
7272
const List = <TEntity,>(props: Props<TEntity>): ReactElement => {
7373
const {
7474
bounceFirstRowOnMount,
75-
innerRef,
75+
innerRef: _innerRef,
7676
onRefresh,
7777
ListEmptyComponent,
7878
ListFooterComponent,

src/common/ListItem.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ const ListItem = <TItem,>(props: Props<TItem>): ReactElement => {
8989
}
9090
}, [swipeable, item, props]);
9191

92-
const rightIconElement =
93-
rightIcon != null ? (
94-
isValidElement(rightIcon) ? (
95-
rightIcon
96-
) : (
97-
<Icon {...rightIcon} />
98-
)
99-
) : null;
92+
let rightIconElement: React.ReactNode = null;
93+
if (rightIcon != null) {
94+
rightIconElement = isValidElement(rightIcon) ? (
95+
rightIcon
96+
) : (
97+
<Icon {...rightIcon} />
98+
);
99+
}
100100

101101
const content = (
102102
<Fragment>

src/common/LoadingListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import * as React from 'react';
22

33
import { StyleSheet } from 'react-native';
44

5-
import { COLORS } from 'theme';
65
import { ListItem } from 'common/ListItem';
6+
import { COLORS } from 'theme';
77

88
import type { StyleProp, ViewStyle } from 'react-native';
99

src/common/WarningNotification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as React from 'react';
33
import { Icon } from '@rneui/themed';
44
import { StyleSheet, Text, View } from 'react-native';
55

6-
import { COLORS, TYPOGRAPHY } from 'theme';
76
import { TouchableItem } from 'common/buttons/TouchableItem';
7+
import { COLORS, TYPOGRAPHY } from 'theme';
88

99
const styles = StyleSheet.create({
1010
container: {

src/common/form/DropdownInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export type DropdownInputProps<
6262

6363
// Wrapper: WebDropdown on web, react-native-element-dropdown on native. Props match DropdownProps.
6464

65-
const Dropdown = <TValueType,>(props: DropdownProps) => {
65+
const Dropdown = <_TValueType,>(props: DropdownProps) => {
6666
if (Platform.OS === 'web') {
6767
return <WebDropdown {...props} />;
6868
}
@@ -96,7 +96,7 @@ export const DropdownInput = <TFormFields extends FieldValues, TValueType>({
9696
labelField,
9797
testID,
9898
mode = 'default',
99-
headerTitle,
99+
headerTitle: _headerTitle,
100100
confirmSelectItem = false,
101101
onConfirmSelectItem,
102102
useQueryHook,

src/components/DeviceOnlineOverviewItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22

3-
import { DeviceOnlineIndicator } from 'components/DeviceOnlineIndicator';
43
import { OverviewItem2 } from 'common/OverviewItem2';
4+
import { DeviceOnlineIndicator } from 'components/DeviceOnlineIndicator';
55
import { useGetParticleAttributes } from 'hooks/queries/CloudDeviceQueries';
66

77
import type { EntityID } from '@brewskey/js-api';

0 commit comments

Comments
 (0)