Skip to content

Commit 07d42e9

Browse files
chore(sonar): no need to import react
1 parent 72a5166 commit 07d42e9

Some content is hidden

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

57 files changed

+84
-113
lines changed

.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ module.exports = {
4646
project: './tsconfig.json',
4747
},
4848
rules: {
49+
'react/react-in-jsx-scope': 'off',
50+
'react/jsx-uses-react': 'off',
4951
'prettier/prettier': [
5052
'error',
5153
{
@@ -79,6 +81,18 @@ module.exports = {
7981
caughtErrorsIgnorePattern: '^_',
8082
},
8183
],
84+
'no-restricted-imports': [
85+
'error',
86+
{
87+
paths: [
88+
{
89+
name: 'react',
90+
importNames: ['default'],
91+
message: 'No need to import React',
92+
},
93+
],
94+
},
95+
],
8296
curly: [2, 'all'],
8397
},
8498
},

docs/src/content/docs/ui-and-theme/Forms.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Here is how you can create your login screen:
5353

5454
```tsx
5555
import { zodResolver } from '@hookform/resolvers/zod';
56-
import React from 'react';
5756
import { useForm } from 'react-hook-form';
5857
import z from 'zod';
5958

src/api/common/api-provider.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { useReactQueryDevTools } from '@dev-plugins/react-query';
22
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3-
import React from 'react';
4-
53
export const queryClient = new QueryClient();
64

75
export function APIProvider({ children }: { children: React.ReactNode }) {

src/app/(app)/_layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable react/no-unstable-nested-components */
22
import { Link, Redirect, SplashScreen, Tabs } from 'expo-router';
3-
import React, { useCallback, useEffect } from 'react';
3+
import { useCallback, useEffect } from 'react';
44

55
import { useAuth, useIsFirstTime } from '@/core';
66
import { Pressable, Text } from '@/ui';

src/app/(app)/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FlashList } from '@shopify/flash-list';
2-
import React from 'react';
2+
import { useCallback } from 'react';
33

44
import type { Post } from '@/api';
55
import { usePosts } from '@/api';
@@ -8,7 +8,7 @@ import { EmptyList, FocusAwareStatusBar, Text, View } from '@/ui';
88

99
export default function Feed() {
1010
const { data, isPending, isError } = usePosts();
11-
const renderItem = React.useCallback(
11+
const renderItem = useCallback(
1212
({ item }: { item: Post }) => <Card {...item} />,
1313
[]
1414
);

src/app/(app)/settings.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/react-in-jsx-scope */
21
import { Env } from '@env';
32
import { useColorScheme } from 'nativewind';
43

src/app/(app)/style.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react';
2-
31
import { Buttons } from '@/components/buttons';
42
import { Colors } from '@/components/colors';
53
import { Inputs } from '@/components/inputs';

src/app/_layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export { ErrorBoundary } from 'expo-router';
1717
// Import global CSS file
1818
import '../../global.css';
1919

20-
import React from 'react';
21-
2220
export const unstable_settings = {
2321
initialRouteName: '(app)',
2422
};

src/app/feed/[id].tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Stack, useLocalSearchParams } from 'expo-router';
2-
import React from 'react';
32

43
import { usePost } from '@/api';
54
import { ActivityIndicator, FocusAwareStatusBar, Text, View } from '@/ui';

src/app/feed/add-post.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { zodResolver } from '@hookform/resolvers/zod';
22
import { Stack } from 'expo-router';
3-
import React from 'react';
43
import { useForm } from 'react-hook-form';
54
import { showMessage } from 'react-native-flash-message';
65
import { z } from 'zod';

0 commit comments

Comments
 (0)