Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit ebf549d

Browse files
committed
cherry-pick and modify from use the eslintrc from react-native github of branch v1.1.x
1 parent be8657a commit ebf549d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1527
-1646
lines changed

.eslintignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
/node_modules/
1+
# node_modules ignored by default
2+
3+
**/staticBundle.js
4+
**/main.js
5+
Libraries/vendor/**/*
6+
27
/web/output/

.eslintrc

Lines changed: 167 additions & 278 deletions
Large diffs are not rendered by default.

index.ios.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import {AppRegistry} from 'react-native';
3-
import Noder from './src';
1+
import React from 'react'
2+
import {AppRegistry} from 'react-native'
3+
import Noder from './src'
44

55

6-
AppRegistry.registerComponent('noder', () => Noder);
6+
AppRegistry.registerComponent('noder', () => Noder)

src/actions/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import * as user from './user';
2-
import * as utils from './utils';
3-
import * as message from './message';
4-
import * as topic from './topic';
1+
import * as user from './user'
2+
import * as utils from './utils'
3+
import * as message from './message'
4+
import * as topic from './topic'
55

66

77
export default {
88
...user,
99
...utils,
1010
...message,
1111
...topic
12-
};
12+
}
1313

1414

src/actions/message.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import {createAction} from 'redux-actions';
2-
import * as types from '../constants/ActionTypes';
3-
import * as messageService from '../services/messageService';
1+
import {createAction} from 'redux-actions'
2+
import * as types from '../constants/ActionTypes'
3+
import * as messageService from '../services/messageService'
44

55

66
export const getUnreadMessageCount = createAction(types.GET_UNREAD_MESSAGE_COUNT, async()=> {
7-
return await messageService.getUnreadMessageCount();
8-
});
7+
return await messageService.getUnreadMessageCount()
8+
})
99

1010

1111
export const markAsRead = createAction(types.MARK_AS_READ, async()=> {
12-
return await messageService.markAsRead();
12+
return await messageService.markAsRead()
1313
}, function (resolved, rejected) {
1414
return {
1515
resolved,
1616
rejected,
1717
sync: 'message'
1818
}
19-
});
19+
})
2020

2121

2222
export const getMessageList = createAction(types.GET_MESSAGES_LIST, async()=> {
23-
return await messageService.getMessages();
23+
return await messageService.getMessages()
2424
}, ()=> {
2525
return {
2626
sync: 'message'
2727
}
28-
});
28+
})

src/actions/topic.js

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
1-
import {createAction} from 'redux-actions';
2-
import * as markdown from 'markdown';
3-
import * as types from '../constants/ActionTypes';
4-
import * as topicService from '../services/topicService';
5-
6-
7-
function setMetaId(id) {
8-
return {
9-
id
10-
}
11-
}
1+
import {createAction} from 'redux-actions'
2+
import * as markdown from 'markdown'
3+
import * as types from '../constants/ActionTypes'
4+
import * as topicService from '../services/topicService'
125

136

147
export const getTopicsByTab = createAction(types.GET_TOPICS_BY_TAB, async(tab, params)=> {
15-
return await topicService.getTopicsByTab(tab, params);
8+
return await topicService.getTopicsByTab(tab, params)
169
}, (tab)=> {
1710
return {
1811
tab
1912
}
20-
});
13+
})
2114

2215

2316
export const updateTopicsByTab = createAction(types.UPDATE_TOPICS_BY_TAB, async(tab)=> {
2417
return await topicService.getTopicsByTab(tab, {
2518
page: 1
26-
});
19+
})
2720
}, (tab)=> {
2821
return {
2922
tab,
3023
sync: 'topic'
3124
}
32-
});
25+
})
3326

3427

3528
export const getTopicById = createAction(types.GET_TOPIC_BY_ID, topicService.getTopicById, (id)=> {
3629
return {
3730
id,
3831
sync: 'topic'
3932
}
40-
});
33+
})
4134

4235

4336
export const removeTopicCacheById = createAction(types.REMOVE_TOPIC_CACHE_BY_ID, (id)=> {
4437
return {
4538
id
4639
}
47-
});
40+
})
4841

4942

5043
export const replyTopicById = createAction(types.REPLY_TOPIC_BY_ID, topicService.reply, ({topicId, content, replyId, user}, resolved, rejected)=> {
@@ -56,7 +49,7 @@ export const replyTopicById = createAction(types.REPLY_TOPIC_BY_ID, topicService
5649
rejected,
5750
user
5851
}
59-
});
52+
})
6053

6154

6255
export const upReply = createAction(types.UP_REPLY, topicService.upReply, ({topicId, replyId, userId, resolved, rejected})=> {
@@ -67,12 +60,12 @@ export const upReply = createAction(types.UP_REPLY, topicService.upReply, ({topi
6760
resolved,
6861
rejected
6962
}
70-
});
63+
})
7164

7265

7366
export const publish = createAction(types.PUBLISH, topicService.publish, ({resolved, rejected})=> {
7467
return {
7568
resolved,
7669
rejected
7770
}
78-
});
71+
})

src/actions/user.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
import {createAction} from 'redux-actions';
2-
import * as types from '../constants/ActionTypes';
3-
import * as userService from '../services/userService';
4-
import * as tokenService from '../services/token';
5-
import * as storageService from '../services/storage';
1+
import {createAction} from 'redux-actions'
2+
import * as types from '../constants/ActionTypes'
3+
import * as userService from '../services/userService'
4+
import * as tokenService from '../services/token'
5+
import * as storageService from '../services/storage'
66

77
export const checkToken = createAction(types.CHECK_TOKEN, async(token)=> {
8-
const userLoginInfo = await userService.checkToken(token);
8+
const userLoginInfo = await userService.checkToken(token)
99
const user = await userService
1010
.getUserInfo(userLoginInfo.loginname)
1111
.then((data)=> {
1212
return {
1313
secret: userLoginInfo,
1414
publicInfo: data
15-
};
16-
});
17-
tokenService.setToken(token);
18-
return user;
15+
}
16+
})
17+
tokenService.setToken(token)
18+
return user
1919
}, (token, resolved)=> {
2020
return {
2121
resolved: resolved,
2222
sync: 'user'
2323
}
24-
});
24+
})
2525

2626

2727
export const updateClientUserInfo = createAction(types.UPDATE_CLIENT_USER_INFO, async(user)=> {
2828
return await userService.getUserInfo(user.secret.loginname)
2929
.then(userInfo=> {
3030
if (userInfo) {
31-
return userInfo;
31+
return userInfo
3232
}
3333
throw 'getUserInfoError'
34-
});
34+
})
3535
}, ()=> {
3636
return {
3737
sync: 'user'
3838
}
39-
});
39+
})
4040

4141

4242
export const getUserInfo = createAction(types.GET_USER_INFO, async(loginName)=> {
4343
return await userService.getUserInfo(loginName)
4444
.then(userInfo=> {
4545
if (userInfo) {
46-
return userInfo;
46+
return userInfo
4747
}
4848
throw 'getUserInfoError'
49-
});
49+
})
5050
}, (userName)=> {
5151
return {
5252
userName,
5353
sync: 'user'
5454
}
55-
});
55+
})
5656

5757

5858
export const logout = function () {
@@ -62,17 +62,17 @@ export const logout = function () {
6262
sync: 'user'
6363
}
6464
}
65-
};
65+
}
6666

6767
export const clear = function () {
6868
try {
69-
storageService.removeItem('topic');
70-
storageService.removeItem('message');
69+
storageService.removeItem('topic')
70+
storageService.removeItem('message')
7171
}
7272
catch (err) {
73-
console.warn(err);
73+
console.warn(err)
7474
}
7575
return {
7676
type: types.CLEAR
7777
}
78-
};
78+
}

src/actions/utils.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {createAction} from 'redux-actions';
2-
import * as types from '../constants/ActionTypes';
3-
import * as storageService from '../services/storage';
1+
import {createAction} from 'redux-actions'
2+
import * as types from '../constants/ActionTypes'
3+
import * as storageService from '../services/storage'
44

55

6-
const syncReducer = ['user', 'message', 'topic'];
6+
const syncReducer = ['user', 'message', 'topic']
77

88

99
export const toast = createAction(types.TOAST, (text, timeout)=> {
@@ -12,27 +12,27 @@ export const toast = createAction(types.TOAST, (text, timeout)=> {
1212
timeout,
1313
id: new Date().getTime()
1414
}
15-
});
15+
})
1616

1717

1818
export const getReducerFromAsyncStorage = createAction(types.GET_REDUCER_FROM_ASYNC_STORAGE, async()=> {
1919
return storageService.multiGet(syncReducer)
2020
.then(arr=> {
21-
let ob = {};
21+
let ob = {}
2222
arr.forEach(item=> {
23-
ob[item[0]] = item[1];
24-
});
23+
ob[item[0]] = item[1]
24+
})
2525
if (ob.user && ob.user.secret) {
26-
global.token = ob.user.secret.token;
26+
global.token = ob.user.secret.token
2727
}
28-
return ob;
28+
return ob
2929
})
3030
.catch(err=> {
31-
console.warn(err);
32-
});
31+
console.warn(err)
32+
})
3333
}, (resolved, rejected)=> {
3434
return {
3535
resolved,
3636
rejected
3737
}
38-
});
38+
})

src/components/CommentHtml.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, {Component} from 'react';
2-
import {StyleSheet, Image, Dimensions} from 'react-native';
3-
import Html from './base/Html';
1+
import React, {Component} from 'react'
2+
import {StyleSheet, Image, Dimensions} from 'react-native'
3+
import Html from './base/Html'
44

55

6-
const {height, width} = Dimensions.get('window');
6+
const {width} = Dimensions.get('window')
77

88

99
class CommentHtml extends Component {
1010
constructor(props) {
11-
super(props);
11+
super(props)
1212
if (this.props.style) {
1313
this.styles = Object.assign({}, styles, this.props.style)
1414
}
@@ -27,8 +27,8 @@ class CommentHtml extends Component {
2727
}
2828

2929

30-
const fontSize = 14;
31-
const titleMargin = 5;
30+
const fontSize = 14
31+
const titleMargin = 5
3232

3333
const styles = StyleSheet.create({
3434
p: {
@@ -51,7 +51,7 @@ const styles = StyleSheet.create({
5151
},
5252
h1: {
5353
fontSize: fontSize * 1.6,
54-
fontWeight: "bold",
54+
fontWeight: 'bold',
5555
color: 'rgba(0,0,0,0.8)'
5656
},
5757
h1wrapper: {
@@ -174,7 +174,7 @@ const styles = StyleSheet.create({
174174
resizeMode: Image.resizeMode.contain,
175175
margin: 10
176176
}
177-
});
177+
})
178178

179179

180-
export default CommentHtml;
180+
export default CommentHtml

0 commit comments

Comments
 (0)