Skip to content

Commit

Permalink
removed type system, added eslint
Browse files Browse the repository at this point in the history
typescript was causing issues with static assets, flowtype had a lot of error with node_modules, needed to removed both of them to have a proper structure for the app
  • Loading branch information
proshoumma committed Jan 23, 2018
1 parent d75afbf commit 2e0e3b8
Show file tree
Hide file tree
Showing 13 changed files with 381 additions and 287 deletions.
17 changes: 17 additions & 0 deletions .eslintrc
@@ -0,0 +1,17 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"jest": true
},
"plugins": [
"react"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"rules": {
"semi": ["error", "never"]
}
}
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -51,6 +51,3 @@ buck-out/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# distribution files
dist
4 changes: 2 additions & 2 deletions index.js
@@ -1,2 +1,2 @@
// use the App.tsx as the main entry point
import * as App from './dist/App'
// use the App.js as the main entry point
import * as App from './src/App'
16 changes: 4 additions & 12 deletions package.json
Expand Up @@ -4,9 +4,6 @@
"private": true,
"scripts": {
"start": "react-native start",
"build": "rimraf ./dist && tsc",
"tsc": "tsc",
"tsc:watch": "tsc --watch",
"test": "jest"
},
"dependencies": {
Expand All @@ -16,18 +13,13 @@
"react-native-navigation": "^1.1.346"
},
"devDependencies": {
"@types/jest": "^22.0.1",
"@types/lodash": "^4.14.93",
"@types/react": "^16.0.34",
"@types/react-native": "0.51.0",
"@types/react-test-renderer": "^16.0.0",
"babel-eslint": "^8.2.1",
"babel-jest": "22.1.0",
"babel-preset-react-native": "4.0.0",
"eslint": "^4.16.0",
"eslint-plugin-react": "^7.5.1",
"jest": "22.1.1",
"react-test-renderer": "16.2.0",
"rimraf": "^2.6.2",
"tslint": "^5.9.1",
"typescript": "^2.6.2"
"react-test-renderer": "16.2.0"
},
"jest": {
"preset": "react-native"
Expand Down
4 changes: 2 additions & 2 deletions src/App.ts → src/App.js
@@ -1,15 +1,15 @@
import { Navigation } from 'react-native-navigation'

import { registerScreens } from './screens'
import { LANDING } from './screens/constants'
import { routeNames } from './constants'

// register all the screens
registerScreens()

// start the app
Navigation.startSingleScreenApp({
screen: {
screen: LANDING
screen: routeNames.LANDING
}
})

Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/App.tsx → src/__tests__/App.js
@@ -1,11 +1,11 @@
import {} from 'jest'
import * as _ from 'lodash'
import _ from 'lodash'
import { Navigation } from 'react-native-navigation'

import App from '../App'

describe('App', () => {
it('got a Navigation object', () => {
it('is a Navigation object', () => {
expect(_.isEqual(App, Navigation)).toBe(true)
})
})
4 changes: 3 additions & 1 deletion src/screens/constants.ts → src/constants.js
@@ -1,2 +1,4 @@
// using constants for screen names for avoiding mistakes
export const LANDING:string = 'Landing'
export const routeNames = {
LANDING: 'Landing'
}
14 changes: 0 additions & 14 deletions src/screens/Landing/__tests__/index.tsx

This file was deleted.

@@ -1,14 +1,14 @@
import * as React from 'react'
import React, { Component } from 'react'
import {
View,
Text
} from 'react-native'

class Landing extends React.Component {
class Landing extends Component {
render() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Hello From Landing Screen</Text>
<Text>Hello From Landing</Text>
</View>
)
}
Expand Down
6 changes: 5 additions & 1 deletion src/screens/index.ts → src/screens/index.js
@@ -1,8 +1,12 @@
import { Navigation } from 'react-native-navigation'

import Landing from './Landing'
import { LANDING } from './constants'
import { routeNames } from '../constants'

export function registerScreens() {
const {
LANDING
} = routeNames

Navigation.registerComponent(LANDING, () => Landing)
}
21 changes: 0 additions & 21 deletions tsconfig.json

This file was deleted.

153 changes: 0 additions & 153 deletions typeDeclarations/react-native-navigation.d.ts

This file was deleted.

0 comments on commit 2e0e3b8

Please sign in to comment.