Compare commits

...
11 Commits
Author SHA1 Message Date
Jesse Katsumata dda75c0514 chore: apply prettier (#115) 2020-01-06 12:18:08 +01:00
Emin Khateeb 9eba4e6e48 completed eslint ts setup and fixed eslint issues (#112)
* completed eslint ts setup and fixed eslint issues

* minor change in direction 😄

* upgraded type definitions

* declared custom global variable

* moved global var definition below imports
2019-12-20 08:36:16 +01:00
Emin Khateeb e31c51d8c5 matched eslint version (#111)
to be the same as in the default template and also updated typescript eslint parser
2019-12-20 07:18:33 +01:00
Rodinei Fagundes e75a4da89d add eslint dependencies (#107) 2019-12-20 05:35:06 +01:00
Joe Redridge b71dc7e3c4 Upgrade typescript to 3.7.3 (#110) 2019-12-13 12:24:14 +01:00
Radek Czemerys 0f552603cb Update for RN 0.61.5 (#109) 2019-12-05 17:52:02 +01:00
Takagi Kensuke 0768a6257c Make note on the legacy CLI stand out (#103) 2019-11-12 12:37:48 +01:00
Radek Czemerys fe7597ca09 Update for 0.61.4 (#98)
* Update for 0.61.4

* Update RN @types version
2019-11-07 15:04:36 +01:00
Kenny b51d726881 Update tsconfig.json (#100)
Add incremental item into default tsconfig.json, more references: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#--incremental-improvements
2019-11-07 09:53:44 +01:00
Radek Czemerys 9721ad6530 Update for RN 0.61.3 (#96) 2019-10-30 10:34:43 +01:00
Alexander Jarvis b228bb4f36 Fix type errors as react types are included in react-native (#95) 2019-10-25 10:36:37 +02:00
5 changed files with 26 additions and 19 deletions

No files matched your search

+7 -7
View File
@@ -25,23 +25,23 @@
## :arrow_forward: Usage
> `react-native@0.61.0` or higher
### Note on the legacy CLI
There seems to be quite some confusion about the legacy CLI. This template only works with the new CLI. Make sure you have uninstalled the legacy `react-native-cli` first (`npm uninstall -g react-native-cli`), for the below command to work. If you wish to not use `npx`, you can also install the new CLI globally (`npm i -g @react-native-community/cli` or `yarn global add @react-native-community/cli`).
Further information can be found here: https://github.com/react-native-community/cli#about
### `react-native@0.61.0` or higher
```sh
npx react-native init MyApp --template react-native-template-typescript
```
> `react-native@0.60.x`
### `react-native@0.60.x`
```sh
npx react-native init MyApp --template react-native-template-typescript@6.2.0
```
### Note on the legacy CLI
There seems to be quite some confusion about the legacy CLI. This template only works with the new CLI. Make sure you have uninstalled the legacy `react-native-cli` first (`npm uninstall -g react-native-cli`), for the above command to work. If you wish to not use `npx`, you can also install the new CLI globally (`npm i -g @react-native-community/cli` or `yarn global add @react-native-community/cli`).
Further information can be found here: https://github.com/react-native-community/cli#about
## :computer: Contributing
Contributions are very welcome. Please check out the [contributing document](CONTRIBUTING.md).
+5 -4
View File
@@ -26,8 +26,9 @@ import {
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
declare var global: {HermesInternal: null | {}};
const App = () => {
const usingHermes = typeof HermesInternal === 'object' && HermesInternal !== null;
return (
<>
<StatusBar barStyle="dark-content" />
@@ -36,7 +37,7 @@ const App = () => {
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
{!usingHermes ? null : (
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
@@ -45,8 +46,8 @@ const App = () => {
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Step One</Text>
<Text style={styles.sectionDescription}>
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
screen and then come back to see your edits.
Edit <Text style={styles.highlight}>App.tsx</Text> to change
this screen and then come back to see your edits.
</Text>
</View>
<View style={styles.sectionContainer}>
+2
View File
@@ -1,4 +1,6 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
};
+10 -7
View File
@@ -6,25 +6,28 @@
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest"
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.2"
"react-native": "0.61.5"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"@types/jest": "^24.0.18",
"@types/react": "16.9.0",
"@types/react-native": "^0.60.17",
"@types/react-test-renderer": "16.9.0",
"@types/jest": "^24.0.24",
"@types/react-native": "^0.60.25",
"@types/react-test-renderer": "16.9.1",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0",
"typescript": "^3.6.3"
"typescript": "^3.7.3"
},
"jest": {
"preset": "react-native",
+2 -1
View File
@@ -15,6 +15,7 @@
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "removeComments": true, /* Do not emit comments to output. */
"noEmit": true, /* Do not emit outputs. */
"incremental": true, /* Enable incremental compilation */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
"isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
@@ -58,4 +59,4 @@
"exclude": [
"node_modules", "babel.config.js", "metro.config.js", "jest.config.js"
]
}
}