Tools are working

This commit is contained in:
Federico Kereki 2018-08-25 22:25:58 -03:00
parent 4f00f6518b
commit 01b438322a
10 changed files with 2197 additions and 32 deletions

View File

@ -2,7 +2,10 @@
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"node": true,

View File

@ -2,7 +2,10 @@
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"node": true,

View File

@ -2,7 +2,10 @@
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"node": true,

30
chapter11/.eslintrc Normal file
View File

@ -0,0 +1,30 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"node": true,
"browser": true,
"es6": true,
"jest": true,
"react-native/react-native": true
},
"extends": [
"eslint:recommended",
"plugin:flowtype/recommended",
"plugin:react/recommended",
"plugin:react-native/all"
],
"plugins": ["babel", "flowtype", "react", "react-native"],
"rules": {
"no-console": "off",
"no-var": "error",
"prefer-const": "error",
"flowtype/no-types-missing-file-annotation": 0
}
}

17
chapter11/.flowconfig Normal file
View File

@ -0,0 +1,17 @@
[ignore]
.*/node_modules/.*
[include]
[libs]
[lints]
all=warn
untyped-type-import=off
unsafe-getters-setters=off
[options]
include_warnings=true
module.file_ext=.scss
[strict]

5
chapter11/.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"tabWidth": 4,
"printWidth": 75
}

View File

@ -1,7 +1,9 @@
/* @flow */
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class App extends React.Component {
export default class App extends React.Component<> {
render() {
return (
<View style={styles.container}>
@ -13,10 +15,12 @@ export default class App extends React.Component {
}
}
const white: string = "#fff";
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
backgroundColor: white,
alignItems: "center",
justifyContent: "center"
}

23
chapter11/App.original.js Normal file
View File

@ -0,0 +1,23 @@
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center"
}
});

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,38 @@
{
"name": "chapter10",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.14.0",
"jest-expo": "~27.0.0",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2"
}
"name": "chapter10",
"version": "0.1.0",
"private": true,
"devDependencies": {
"eslint": "^5.4.0",
"eslint-config-recommended": "^3.0.0",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-native": "^3.2.1",
"flow": "^0.2.3",
"flow-bin": "^0.79.1",
"flow-coverage-report": "^0.5.0",
"flow-typed": "^2.5.1",
"jest-expo": "~27.0.0",
"react-native-scripts": "1.14.0",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest",
"flow": "flow",
"addTypes": "flow-typed install"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2"
}
}