Skip to content

Commit 688b2d6

Browse files
committed
update eslint packages, fix lint error in actions
1 parent 5b42972 commit 688b2d6

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"globals": {
44
"fetch": false,
55
"FormData": false
6-
}
6+
}
77
}

app/actions/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
UPDATE_MESSAGES,
66
UPDATE_USERS,
77
UPDATE_POINTER,
8-
} from '../constants.js';
8+
} from '../constants';
99

1010
export function markAsRead(messages) {
1111
return (dispatch, getState) => {
12-
const config = getState().config;
12+
const { config } = getState();
1313
const z = zulip(config);
1414
const flag = 'read';
1515
return z.messages.flags.add({ flag, messages });
@@ -18,7 +18,7 @@ export function markAsRead(messages) {
1818

1919
export function updatePointer(id) {
2020
return (dispatch, getState) => {
21-
const config = getState().config;
21+
const { config } = getState();
2222
return zulip(config).users.me.pointer.update(id).then(({ result }) => {
2323
if (result === 'success') {
2424
dispatch({
@@ -43,7 +43,7 @@ export function fetchPointer(dispatch, config) {
4343

4444
export function fetchStreams(redirect) {
4545
return (dispatch, getState) => {
46-
const config = getState().config;
46+
const { config } = getState();
4747
const z = zulip(config);
4848
return z.streams.retrieve().then((res) => {
4949
dispatch({
@@ -57,14 +57,13 @@ export function fetchStreams(redirect) {
5757

5858
export function fetchMessages(anchor) {
5959
return (dispatch, getState) => {
60-
const config = getState().config;
60+
const { config, messages } = getState();
6161
const params = {
6262
num_before: 10,
6363
num_after: 20,
6464
anchor,
6565
};
6666
if (!anchor) {
67-
const messages = getState().messages;
6867
const lastMessage = messages[messages.length - 1];
6968
params.num_before = 0;
7069
params.anchor = lastMessage.id;
@@ -80,7 +79,7 @@ export function fetchMessages(anchor) {
8079

8180
export function fetchUsers(redirect) {
8281
return (dispatch, getState) => {
83-
const config = getState().config;
82+
const { config } = getState();
8483
const z = zulip(config);
8584
return z.users.retrieve({}).then((res) => {
8685
const users = [].concat(res.members);

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
"zulip-js": "git+https://github.com/arpith/zulip-js.git"
4848
},
4949
"devDependencies": {
50-
"eslint": "^3.5.0",
51-
"eslint-config-airbnb": "^11.1.0",
52-
"eslint-plugin-import": "^1.15.0",
53-
"eslint-plugin-jsx-a11y": "^2.2.2",
54-
"eslint-plugin-react": "^6.2.0"
50+
"eslint": "^4.15.0",
51+
"eslint-config-airbnb": "^16.1.0",
52+
"eslint-plugin-import": "^2.8.0",
53+
"eslint-plugin-jsx-a11y": "^6.0.3",
54+
"eslint-plugin-react": "^7.5.1"
5555
}
5656
}

0 commit comments

Comments
 (0)