8000 initial commit · codeReader52/scripts@1e45f46 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e45f46

Browse files
committed
initial commit
0 parents  commit 1e45f46

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@react-native-community', 'eslint:recommended', 'google'],
4+
rules: {
5+
'comma-dangle': ['error', 'never'],
6+
'quote-props': ['error', 'as-needed'],
7+
'max-len': ['error', {code: 120}]
8+
}
9+
};

.prettierrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'none',
6+
semi: true,
7+
printWidth: 120,
8+
arrowParens: 'always',
9+
bracketSpacing: true
10+
};

init.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
# arg1: name of prject (compulsory)
4+
# arg2: name of folder to put the project in (optional). Default to current folder.
5+
6+
# bash script to initialize a basic react native project
7+
# pardon my noob bash skill... too lazy to build actual function 😅 LOL!!!
8+
9+
# PREREQUISITE: NEED YARN INSTALLED GLOBALLY
10 10000 +
11+
app_name=$1
12+
project_location=$2
13+
current_location=$(pwd)
14+
15+
if [ -z $app_name ]; then
16+
echo "Fatal error: "
17+
echo "No project name is specified."
18+
exit 1234
19+
fi
20+
21+
if [ -z $project_location ]; then
22+
echo "No root location of the project is defined. Creating root project in current folder".
23+
project_location=$current_location
24+
fi
25+
26+
if [ ! -d $project_location ]; then
27+
echo "Fatal error: "
28+
echo "Folder $project_location does not exist."
29+
exit 1234
30+
fi
31+
32+
33+
34+
cd $project_location
35+
36+
rm -rf $app_name
37+
38+
yarn global add expo-cli
39+
expo init $app_name
40+
41+
cd $app_name
42+
43+
yarn add --dev typescript
44+
yarn add --dev @types/react @types/react-native
45+
yarn add --dev eslint eslint-config-google
46+
yarn add --dev react-native-typescript-transformer
47+
48+
cp $current_location/.eslintrc.js .
49+
cp $current_location/.prettierrc.js .
50+
cp $current_location/metro.config.js .
51+
52+
yarn eslint --fix

metro.config.js

Lines changed: 5 additions & 0 deletions
< 54BB table aria-label="Diff for: metro.config.js" class="tab-size width-full DiffLines-module__tableLayoutFixed--ZmaVx" data-diff-anchor="diff-eb288b08cb881cff653283c14cb9630dc0924a1751950e1562a8ca2c0b39694b" data-tab-size="8" data-paste-markdown-skip="true" role="grid" style="--line-number-cell-width:40px;--line-number-cell-width-unified:80px">Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
transformer: {
3+
babelTransformerPath: require.resolve('react-native-typescript-transformer')
4+
}
5+
};

0 commit comments

Comments
 (0)
0