Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ settings:
onlyFilesWithFlowAnnotation: true
globals:
__DEV__: true
ReactClass: true
ReactElement: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robwise @alexfedoseev Should these go into the shakacode linter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it React Native specific?

Copy link

@robwise robwise Dec 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't React-Native specific, these are used when typing React with flow. If you use eslint-plugin-flowtype, defining these as globals isn't necessary and these can be removed. I would also recommend using the recommend configuation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is crazy train, I can't find anything about ReactElement here. AFAIR I had issues w/ it and bunch of examples were using React$Element—it is in the defs, but it wasn't work either. Then I found this post, where stated that ReactElement is removed from public API and React.Element should be used instead. The funny thing is that it worked and still works, but: there is no Element property on React object lol.

rules:
react-native/no-unused-styles: 2
react-native/split-platform-components: 2
Expand All @@ -43,3 +45,7 @@ rules:
flowtype/type-id-match:
- 1
- "^([A-Z][a-z0-9]+)+Type$"

react/jsx-filename-extension:
- 1
- extensions: [".js", ".jsx"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robwise @alexfedoseev How about we put this into the shakacode linter?

Copy link

@robwise robwise Dec 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justin808 I commented on the styleguide repo, what's the reasoning?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justin808 It should be:

react/jsx-filename-extension:
  - 1
  - extensions: [".js"]

# or

react/jsx-filename-extension:
  - 1
  - extensions: [".jsx"]

In general I'm fine w/ either, but as we already have a big codebase, that's using .jsx, I'd stay were we are as there's no reason to spend time on this change.

3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js
.*/node_modules/react-native/Libraries/Components/StaticContainer.js

; https://github.com/aksonov/react-native-router-flux/issues/892#issuecomment-230104301
.*/node_modules/react-native-experimental-navigation/.*
Expand Down Expand Up @@ -45,4 +46,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
unsafe.enable_getters_and_setters=true

[version]
^0.36.0
^0.35.0
2 changes: 1 addition & 1 deletion app/bundles/comments/components/Add/AddStyle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StyleSheet } from 'react-native';
import * as colors from 'ReactRailsApp/app/styles/colors';
import * as colors from 'app/styles/colors';

const styles = StyleSheet.create({
button: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StyleSheet } from 'react-native';
import * as colors from 'ReactRailsApp/app/styles/colors';
import * as colors from 'app/styles/colors';

const styles = StyleSheet.create({
container: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StyleSheet } from 'react-native';
import * as colors from 'ReactRailsApp/app/styles/colors';
import * as colors from 'app/styles/colors';

const styles = StyleSheet.create({
container: {
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/comments/hocs/withAddProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';

import commentFormSelector from 'ReactRailsApp/app/selectors/commentFormSelector';
import commentFormSelector from 'app/selectors/commentFormSelector';
import * as actions from '../thunks';

export type AddPropsType = {
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/comments/hocs/withIndexProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';

import commentsPropsSelector from 'ReactRailsApp/app/selectors/commentsPropsSelector';
import commentsPropsSelector from 'app/selectors/commentsPropsSelector';
import * as actions from '../thunks';

type CommentType = {
Expand Down
10 changes: 5 additions & 5 deletions app/bundles/comments/thunks/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Alert } from 'react-native';
import { Actions as navigationActions } from 'react-native-router-flux';
import { reduxUtils } from 'ReactRailsApp/app/utils';
import commentsStoreSelector from 'ReactRailsApp/app/selectors/commentsStoreSelector';
import commentFormSelector from 'ReactRailsApp/app/selectors/commentFormSelector';
import { reduxUtils } from 'app/utils';
import commentsStoreSelector from 'app/selectors/commentsStoreSelector';
import commentFormSelector from 'app/selectors/commentFormSelector';

import { actions as reduxActions } from 'ReactRailsApp/app/reducers';
import * as api from 'ReactRailsApp/app/api';
import { actions as reduxActions } from 'app/reducers';
import * as api from 'app/api';

export const fetch = () =>
async function fetchCommentsThunk(dispatch, _getState, call) {
Expand Down
19 changes: 19 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "app",
"dependencies": {
"immutable": "*",
"lodash": "*",
"normalizr": "*",
"react": "*",
"react-native": "*",
"react-native-elements": "*",
"react-native-router-flux": "*",
"react-native-vector-icons": "*",
"react-redux": "*",
"redux": "*",
"redux-immutable": "*",
"redux-thunk": "*",
"reselect": "*",
"whatwg-fetch": "*"
}
}
4 changes: 2 additions & 2 deletions app/setup/Router/RouterStyle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyleSheet } from 'react-native';
import * as colors from 'ReactRailsApp/app/styles/colors';
import * as sizes from 'ReactRailsApp/app/styles/sizes';
import * as colors from 'app/styles/colors';
import * as sizes from 'app/styles/sizes';

const styles = StyleSheet.create({
container: {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "ReactRailsApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"name": "ReactRailsApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"flow": "node_modules/flow-bin/cli.js",
"lint": "node_modules/eslint/bin/eslint.js --config .eslintrc.yml app"
},
"dependencies": {
},
"dependencies": {
"immutable": "^3.8.1",
"lodash": "^4.17.2",
"normalizr": "^2.3.0",
"react": "15.4.1",
"react-native": "0.39.1",
"react": "15.4.1",
"react-native": "0.39.1",
"react-native-elements": "^0.7.1",
"react-native-router-flux": "^3.37.0",
"react-native-vector-icons": "^3.0.0",
Expand All @@ -23,7 +23,7 @@
"redux-thunk": "^2.1.0",
"reselect": "^2.5.4",
"whatwg-fetch": "^2.0.1"
},
},
"jest": {
"preset": "jest-react-native",
"setupFiles": [
Expand All @@ -42,7 +42,7 @@
"eslint-plugin-lodash-fp": "^2.1.3",
"eslint-plugin-react": "^6.8.0",
"eslint-plugin-react-native": "^2.2.0",
"flow-bin": "^0.36.0",
"flow-bin": "^0.35.0",
"jest": "17.0.3",
"jest-react-native": "17.1.0",
"react-test-renderer": "15.4.1",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1846,9 +1846,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

flow-bin@^0.36.0:
version "0.36.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.36.0.tgz#557907bd9c2ab0670cfad9e7e906a74b0631e39a"
flow-bin@^0.35.0:
version "0.35.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.35.0.tgz#63d4eb9582ce352541be98e6a424503217141b07"

for-in@^0.1.5:
version "0.1.6"
Expand Down