Skip to content

Commit 2b40d68

Browse files
committed
feat: initial commit
0 parents  commit 2b40d68

34 files changed

+47922
-0
lines changed

.detoxrc.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/** @type {Detox.DetoxConfig} */
2+
module.exports = {
3+
testRunner: {
4+
args: {
5+
$0: 'jest',
6+
config: 'e2e/jest.config.js',
7+
},
8+
jest: {
9+
setupTimeout: 120000,
10+
},
11+
},
12+
apps: {
13+
'ios.release': {
14+
type: 'ios.app',
15+
build:
16+
'xcodebuild -workspace ios/reactnativeboilerplate.xcworkspace -scheme reactnativeboilerplate -configuration Release -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build',
17+
binaryPath:
18+
'ios/build/Build/Products/Release-iphonesimulator/reactnativeboilerplate.app',
19+
},
20+
'android.release': {
21+
type: 'android.apk',
22+
build:
23+
'cd android && ./gradlew :app:assembleRelease :app:assembleAndroidTest -DtestBuildType=release && cd ..',
24+
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
25+
},
26+
},
27+
devices: {
28+
simulator: {
29+
type: 'ios.simulator',
30+
device: {
31+
type: 'iPhone 8',
32+
},
33+
},
34+
emulator: {
35+
type: 'android.emulator',
36+
device: {
37+
avdName: 'Pixel_4',
38+
},
39+
},
40+
},
41+
configurations: {
42+
'ios.release': {
43+
device: 'simulator',
44+
app: 'ios.release',
45+
},
46+
'android.release': {
47+
device: 'emulator',
48+
app: 'android.release',
49+
},
50+
},
51+
};

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
out
3+
!.detoxrc.js

.eslintrc

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
// Configuration for JavaScript files
3+
"extends": ["airbnb-base", "plugin:prettier/recommended"],
4+
"rules": {
5+
"prettier/prettier": [
6+
"error",
7+
{
8+
"singleQuote": true,
9+
"endOfLine": "auto"
10+
}
11+
]
12+
},
13+
"overrides": [
14+
// Configuration for TypeScript files
15+
{
16+
"files": ["**/*.ts", "**/*.tsx"],
17+
"plugins": [
18+
"@typescript-eslint",
19+
"unused-imports",
20+
"tailwindcss",
21+
"simple-import-sort"
22+
],
23+
"extends": [
24+
"plugin:tailwindcss/recommended",
25+
"airbnb",
26+
"airbnb-typescript",
27+
"airbnb/hooks",
28+
"plugin:react/jsx-runtime",
29+
"plugin:prettier/recommended"
30+
],
31+
"parserOptions": {
32+
"project": "./tsconfig.json"
33+
},
34+
"rules": {
35+
"prettier/prettier": [
36+
"error",
37+
{
38+
"singleQuote": true,
39+
"endOfLine": "auto"
40+
}
41+
],
42+
"import/extensions": [
43+
"error",
44+
"ignorePackages",
45+
{
46+
"js": "never",
47+
"jsx": "never",
48+
"ts": "never",
49+
"tsx": "never",
50+
"": "never"
51+
}
52+
], // Avoid missing file extension errors when using '@/' alias
53+
"react/function-component-definition": "off", // Disable Airbnb's specific function type
54+
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
55+
"react/require-default-props": "off", // Allow non-defined react props as undefined
56+
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form
57+
"@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier
58+
"@typescript-eslint/consistent-type-imports": "error", // Ensure `import type` is used when it's necessary
59+
"no-restricted-syntax": [
60+
"error",
61+
"ForInStatement",
62+
"LabeledStatement",
63+
"WithStatement"
64+
], // Overrides Airbnb configuration and enable no-restricted-syntax
65+
"import/prefer-default-export": "off", // Named export is easier to refactor automatically
66+
"simple-import-sort/imports": "error", // Import configuration for `eslint-plugin-simple-import-sort`
67+
"simple-import-sort/exports": "error", // Export configuration for `eslint-plugin-simple-import-sort`
68+
"@typescript-eslint/no-unused-vars": "off",
69+
"unused-imports/no-unused-imports": "error",
70+
"unused-imports/no-unused-vars": [
71+
"error",
72+
{ "argsIgnorePattern": "^_" }
73+
]
74+
}
75+
},
76+
// Configuration for testing
77+
{
78+
"files": ["**/*.test.ts", "**/*.test.tsx"],
79+
"plugins": ["jest", "jest-formatting", "testing-library"],
80+
"extends": [
81+
"plugin:jest/recommended",
82+
"plugin:jest-formatting/recommended",
83+
"plugin:testing-library/react"
84+
]
85+
},
86+
// Configuration for e2e testing
87+
{
88+
"files": ["e2e/**/*.ts"],
89+
"plugins": ["jest", "jest-formatting", "detox"],
90+
"extends": [
91+
"plugin:jest/recommended",
92+
"plugin:jest-formatting/recommended"
93+
],
94+
"parserOptions": {
95+
"project": "./e2e/tsconfig.json"
96+
},
97+
"rules": {
98+
"import/no-extraneous-dependencies": [
99+
"error",
100+
{
101+
"devDependencies": true
102+
}
103+
]
104+
}
105+
}
106+
]
107+
}

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
custom:
2+
["https://donate.stripe.com/7sI5m5146ehfddm7tj", "https://nextlessjs.com"]

.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# dependencies
2+
/node_modules
3+
/.pnp
4+
.pnp.js
5+
6+
# testing
7+
/coverage
8+
9+
# expo
10+
.expo/
11+
android
12+
ios
13+
index.js
14+
15+
# production
16+
dist/
17+
web-build/
18+
19+
# debug
20+
npm-debug.log*
21+
pnpm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
.vscode/.react
25+
26+
# misc
27+
*.jks
28+
*.p8
29+
*.p12
30+
*.key
31+
*.mobileprovision
32+
*.orig.*
33+
*.pem
34+
Thumbs.db
35+
36+
# macOS
37+
.DS_Store
38+
39+
# local env files
40+
.env*.local
41+
42+
# Temporary files created by Metro to check the health of the file watcher
43+
.metro-health-check*

.husky/pre-commit

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# Disable concurent to run `check-types` after ESLint in lint-staged
5+
cd "$(dirname "$0")/.." && npx lint-staged --concurrent false

.vscode/extensions.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode",
5+
"mikestead.dotenv",
6+
"csstools.postcss",
7+
"bradlc.vscode-tailwindcss",
8+
"Orta.vscode-jest",
9+
"msjsdiag.vscode-react-native"
10+
]
11+
}

.vscode/settings.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.detectIndentation": false,
4+
"search.exclude": {
5+
"package-lock.json": true
6+
},
7+
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
8+
"editor.formatOnSave": false,
9+
"editor.codeActionsOnSave": [
10+
"source.addMissingImports",
11+
"source.fixAll.eslint"
12+
],
13+
"jest.autoRun": {
14+
"watch": false // Start the jest with the watch flag
15+
// "onStartup": ["all-tests"] // Run all tests upon project launch
16+
},
17+
"jest.showCoverageOnLoad": true, // Show code coverage when the project is launched
18+
"jest.autoRevealOutput": "on-exec-error", // Don't automatically open test explorer terminal on launch
19+
// Multiple language settings for json and jsonc files
20+
"[json][jsonc][yaml]": {
21+
"editor.formatOnSave": true,
22+
"editor.defaultFormatter": "esbenp.prettier-vscode"
23+
},
24+
"prettier.ignorePath": ".gitignore" // Don't run prettier for files listed in .gitignore
25+
}

.vscode/tasks.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Project wide type checking with TypeScript",
8+
"type": "npm",
9+
"script": "check-types",
10+
"problemMatcher": ["$tsc"],
11+
"group": {
12+
"kind": "build",
13+
"isDefault": true
14+
},
15+
"presentation": {
16+
"clear": true,
17+
"reveal": "never"
18+
}
19+
}
20+
]
21+
}

App.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Main } from '@/Main';
2+
3+
export default Main;

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Remi W.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)