Skip to content

Commit 0c0e958

Browse files
authored
Merge pull request #54 from Resgrid/rn-main
Rn main
2 parents 7e40084 + 30b5924 commit 0c0e958

File tree

1,041 files changed

+51245
-48499
lines changed

Some content is hidden

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

1,041 files changed

+51245
-48499
lines changed

.DS_Store

10 KB
Binary file not shown.

.bundle/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---

.cursorrules

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
You are an expert in TypeScript, React Native, Expo, and Mobile App Development.
2+
3+
Code Style and Structure:
4+
5+
- Write concise, type-safe TypeScript code.
6+
- Use functional components and hooks over class components.
7+
- Ensure components are modular, reusable, and maintainable.
8+
- Organize files by feature, grouping related components, hooks, and styles.
9+
10+
Naming Conventions:
11+
12+
- Use camelCase for variable and function names (e.g., `isFetchingData`, `handleUserInput`).
13+
- Use PascalCase for component names (e.g., `UserProfile`, `ChatScreen`).
14+
- Directory names should be lowercase and hyphenated (e.g., `user-profile`, `chat-screen`).
15+
16+
TypeScript Usage:
17+
18+
- Use TypeScript for all components, favoring interfaces for props and state.
19+
- Enable strict typing in `tsconfig.json`.
20+
- Avoid using `any`; strive for precise types.
21+
- Utilize `React.FC` for defining functional components with props.
22+
23+
Performance Optimization:
24+
25+
- Minimize `useEffect`, `useState`, and heavy computations inside render methods.
26+
- Use `React.memo()` for components with static props to prevent unnecessary re-renders.
27+
- Optimize FlatLists with props like `removeClippedSubviews`, `maxToRenderPerBatch`, and `windowSize`.
28+
- Use `getItemLayout` for FlatLists when items have a consistent size to improve performance.
29+
- Avoid anonymous functions in `renderItem` or event handlers to prevent re-renders.
30+
31+
UI and Styling:
32+
33+
- Use consistent styling, either through `StyleSheet.create()` or Styled Components.
34+
- Ensure responsive design by considering different screen sizes and orientations.
35+
- Optimize image handling using libraries designed for React Native, like `react-native-fast-image`.
36+
37+
Best Practices:
38+
39+
- Follow React Native's threading model to ensure smooth UI performance.
40+
- Utilize Expo's EAS Build and Updates for continuous deployment and Over-The-Air (OTA) updates.
41+
- Use React Navigation for handling navigation and deep linking with best practices.
42+
- Create and use Jest to test to validate all generated components
43+
- Write unit tests for all generated logic
44+
45+
Additional Rules:
46+
47+
- Use `pnpm` as the package manager.
48+
- Use Expo's secure store for sensitive data
49+
- Implement proper offline support
50+
- Use `zustand` for state management
51+
- Use `react-hook-form` for form handling
52+
- Use `react-query` for data fetching
53+
- Use `react-i18next` for internationalization
54+
- Use `react-native-mmkv` for local storage
55+
- Use `axios` for API requests
56+
- Use `gluestack-ui` for UI
57+
- Use `@rnmapbox/maps` for maps, mapping or vehicle navigation
58+
- Use `lucide-react-native` for icons and use those components directly in the markup and don't use the gluestack-ui icon component
59+
- Use ? : for conditional rendering and not &&

.easignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
node_modules/
2+
.expo/
3+
dist/
4+
npm-debug.*
5+
*.jks
6+
*.p8
7+
*.p12
8+
*.key
9+
*.mobileprovision
10+
*.orig.*
11+
web-build/
12+
yarn-error.log
13+
/coverage
14+
# macOS
15+
.DS_Store
16+
/android
17+
/ios
18+
/web
19+
/apps
20+
21+
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
22+
# The following patterns were generated by expo-cli
23+
24+
expo-env.d.ts
25+
# @end expo-cli
26+
27+
# Include a file not in source control
28+
!google-services.json
29+
!credentials.json

src/app/features/calls/pages/close-call/close-call.page.scss renamed to .env.production

File renamed without changes.

src/app/features/calls/pages/edit-call/edit-call.page.scss renamed to .env.staging

File renamed without changes.

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.eslintignorenode_modules
2+
__tests__/
3+
.vscode/
4+
android/
5+
coverage/
6+
ios/
7+
.expo
8+
.expo-shared
9+
docs/
10+
cli/

.eslintrc.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
extends: ['expo', 'plugin:tailwindcss/recommended', 'prettier'],
5+
plugins: [
6+
'prettier',
7+
'unicorn',
8+
'@typescript-eslint',
9+
'unused-imports',
10+
'tailwindcss',
11+
'simple-import-sort',
12+
'eslint-plugin-react-compiler',
13+
],
14+
parserOptions: {
15+
project: './tsconfig.json',
16+
},
17+
rules: {
18+
'prettier/prettier': 'warn',
19+
'max-params': ['error', 10], // Limit the number of parameters in a function to use object instead
20+
'max-lines-per-function': ['error', 1000],
21+
'react/display-name': 'off',
22+
'react/no-inline-styles': 'off',
23+
'react/destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
24+
'react/require-default-props': 'off', // Allow non-defined react props as undefined
25+
'@typescript-eslint/comma-dangle': 'off', // Avoid conflict rule between Eslint and Prettier
26+
'@typescript-eslint/consistent-type-imports': [
27+
'warn',
28+
{
29+
prefer: 'type-imports',
30+
fixStyle: 'inline-type-imports',
31+
disallowTypeAnnotations: true,
32+
},
33+
], // Ensure `import type` is used when it's necessary
34+
'import/prefer-default-export': 'off', // Named export is easier to refactor automatically
35+
'import/no-cycle': ['error', { maxDepth: '∞' }],
36+
'tailwindcss/classnames-order': [
37+
'warn',
38+
{
39+
officialSorting: true,
40+
},
41+
], // Follow the same ordering as the official plugin `prettier-plugin-tailwindcss`
42+
'simple-import-sort/imports': 'error', // Import configuration for `eslint-plugin-simple-import-sort`
43+
'simple-import-sort/exports': 'error', // Export configuration for `eslint-plugin-simple-import-sort`
44+
'@typescript-eslint/no-unused-vars': 'off',
45+
'tailwindcss/no-custom-classname': 'off',
46+
'unused-imports/no-unused-imports': 'error',
47+
'unused-imports/no-unused-vars': [
48+
'error',
49+
{
50+
argsIgnorePattern: '^_',
51+
varsIgnorePattern: '^_',
52+
caughtErrorsIgnorePattern: '^_',
53+
},
54+
],
55+
},
56+
overrides: [
57+
// Configuration for translations files (i18next)
58+
{
59+
files: ['src/translations/*.json'],
60+
extends: ['plugin:i18n-json/recommended'],
61+
rules: {
62+
'i18n-json/valid-message-syntax': [
63+
2,
64+
{
65+
syntax: path.resolve('./scripts/i18next-syntax-validation.js'),
66+
},
67+
],
68+
'i18n-json/valid-json': 2,
69+
'i18n-json/sorted-keys': [
70+
2,
71+
{
72+
order: 'asc',
73+
indentSpaces: 2,
74+
},
75+
],
76+
'i18n-json/identical-keys': [
77+
2,
78+
{
79+
filePath: path.resolve('./src/translations/en.json'),
80+
},
81+
],
82+
'prettier/prettier': [
83+
0,
84+
{
85+
singleQuote: true,
86+
endOfLine: 'auto',
87+
},
88+
],
89+
},
90+
},
91+
{
92+
// Configuration for testing files
93+
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
94+
extends: ['plugin:testing-library/react'],
95+
},
96+
],
97+
};

.eslintrc.json

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)