Using react-native-template-typescript as the starting point, I've removed files that are useless for many and added minor changes. I've wanted to make this as bare as possible, adding some of my influence but not enough that it'd be a pain to change them.
❗❗ Read the instructions at the bottom! This is not a complete template!
- TypeScript
- ESLint
- babel-plugin-module-resolver (when importing, instead of
../../..
, it's nowsrc/...
) @babel/preset-typescript
- jest
- react-test-renderer
- babel-jest
@react-native-community/eslint-config
@types/react-test-renderer
@types/jest
- Removed:
/__tests__/
,/android/
,/ios/
,/.buckconfig
,/.editorconfig
,/.prettierrc.js
,/.gitattributes
,/.watchmanconfig
,/yarn.lock
. - Renamed:
/.eslintrc.js/
->/.eslintrc
. - Added:
/.eslintignore
,/src/
and its sub-folders.
/.eslintrc
: Added personal preferences and removedextends
. I suggest taking a look at this prior to development./package.json
: Removed 'test' script, removedresolutions
andjest
keys./tsconfig.json
: Replaced with my owntsconfig
file. I suggest taking a look at this prior to development./babel.config.js
: Added jsx transform (no need to import 'React' every file 🙏🙏🙏), module resolver previously mentioned and added preset@babel/preset-typescript
.
- Clone this repo. I will reference this template moving forward as
Template
. - Remove all
.keep
files. Needed to make them to show file/src/
file structure. - Create another project with the desired name using the command:
npx react-native init PROJECT_NAME_HERE --template react-native-template-typescript
. I will reference this project moving forward wasTempProject
. - Copy
TempProject
's/android/
and/ios/
folders ->Template
. - Copy
TempProject
's/app.json
->Template
. - Replace
Template
'sname
value in/package.json
withTempProject
's. - Command
yarn
oryarn install
. - Command
yarn upgrade
. - Restart IDE.
If script ubuild
doesn't work, /android/app/src/main/assets
directory might not exist, causing the problem.