Skip to content

Commit b751eca

Browse files
committedOct 17, 2020
chore: update eslint/prettier deps
1 parent 93fc6ad commit b751eca

33 files changed

+836
-423
lines changed
 

‎.eslintrc.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ module.exports = {
55
ecmaVersion: 7,
66
ecmaFeatures: {
77
experimentalObjectRestSpread: true,
8-
jsx: true
8+
jsx: true,
99
},
10-
sourceType: 'module'
10+
sourceType: 'module',
1111
},
1212
extends: ['plugin:jest/recommended', 'prettier'],
1313
plugins: ['json', 'prettier'],
1414
env: {
1515
es6: true,
16-
node: true
16+
node: true,
1717
},
1818
globals: {
1919
document: false,
2020
navigator: false,
21-
window: false
21+
window: false,
2222
},
2323
rules: {
2424
'accessor-pairs': 'error',
@@ -111,7 +111,7 @@ module.exports = {
111111
'spaced-comment': [
112112
'error',
113113
'always',
114-
{ markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] }
114+
{ markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] },
115115
],
116116
'use-isnan': 'error',
117117
'valid-typeof': 'error',
@@ -127,6 +127,6 @@ module.exports = {
127127
'jest/prefer-to-have-length': 'error',
128128
'jest/valid-describe': 'error',
129129
'jest/valid-expect': 'error',
130-
'jest/valid-expect-in-promise': 'error'
131-
}
130+
'jest/valid-expect-in-promise': 'error',
131+
},
132132
};

‎.prettierrc

-5
This file was deleted.

‎examples/github/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const request = https.request(
1111
path: '/repos/paularmstrong/normalizr/issues',
1212
method: 'get',
1313
headers: {
14-
'user-agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)'
15-
}
14+
'user-agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)',
15+
},
1616
},
1717
(res) => {
1818
res.on('data', (d) => {

‎examples/github/schema.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ export const user = new schema.Entity('users');
55
export const label = new schema.Entity('labels');
66

77
export const milestone = new schema.Entity('milestones', {
8-
creator: user
8+
creator: user,
99
});
1010

1111
export const issue = new schema.Entity('issues', {
1212
assignee: user,
1313
assignees: [user],
1414
labels: label,
1515
milestone,
16-
user
16+
user,
1717
});
1818

1919
export const pullRequest = new schema.Entity('pullRequests', {
2020
assignee: user,
2121
assignees: [user],
2222
labels: label,
2323
milestone,
24-
user
24+
user,
2525
});
2626

2727
export const issueOrPullRequest = new schema.Array(
2828
{
2929
issues: issue,
30-
pullRequests: pullRequest
30+
pullRequests: pullRequest,
3131
},
3232
(entity) => (entity.pull_request ? 'pullRequests' : 'issues')
3333
);

‎examples/redux/index.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const start = () => {
1818
return 'Repo slug must be in the form "user/project"';
1919
}
2020
return true;
21-
}
22-
}
21+
},
22+
},
2323
])
2424
.then(({ repo }) => {
2525
store.dispatch(Action.setRepo(repo));
@@ -34,8 +34,8 @@ const main = () => {
3434
type: 'list',
3535
name: 'action',
3636
message: 'What would you like to do?',
37-
choices: ['Browse current state', 'Get new data', new inquirer.Separator(), 'Quit']
38-
}
37+
choices: ['Browse current state', 'Get new data', new inquirer.Separator(), 'Quit'],
38+
},
3939
])
4040
.then(({ action }) => {
4141
switch (action) {
@@ -62,10 +62,10 @@ const browseMain = () => {
6262
new inquirer.Separator(),
6363
...Object.keys(store.getState()).map((value) => ({ value, name: `Browse ${value}` })),
6464
new inquirer.Separator(),
65-
{ value: 'main', name: 'Go Back to Main Menu' }
65+
{ value: 'main', name: 'Go Back to Main Menu' },
6666
];
67-
}
68-
}
67+
},
68+
},
6969
])
7070
.then((answers) => {
7171
switch (answers.browseMainAction) {
@@ -95,16 +95,16 @@ const browse = (stateKey) => {
9595
{ value: 'denormalize', name: 'Denormalize' },
9696
new inquirer.Separator(),
9797
{ value: 'browseMain', name: 'Go Back to Browse Menu' },
98-
{ value: 'main', name: 'Go Back to Main Menu' }
99-
]
98+
{ value: 'main', name: 'Go Back to Main Menu' },
99+
],
100100
},
101101
{
102102
type: 'list',
103103
name: 'list',
104104
message: `Select the ${stateKey} to view:`,
105105
choices: Object.keys(store.getState()[stateKey]),
106-
when: ({ action }) => action === 'view'
107-
}
106+
when: ({ action }) => action === 'view',
107+
},
108108
])
109109
.then(({ action, list }) => {
110110
const state = store.getState()[stateKey];
@@ -144,9 +144,9 @@ const browseDenormalized = (stateKey) => {
144144
...Object.keys(store.getState()[stateKey]),
145145
new inquirer.Separator(),
146146
{ value: 'browse', name: 'Go Back to Browse Menu' },
147-
{ value: 'main', name: 'Go Back to Main Menu' }
148-
]
149-
}
147+
{ value: 'main', name: 'Go Back to Main Menu' },
148+
],
149+
},
150150
])
151151
.then(({ selector }) => {
152152
switch (selector) {
@@ -174,10 +174,10 @@ const pull = () => {
174174
return [
175175
...Object.keys(store.getState()).map((value) => ({ value, name: value })),
176176
new inquirer.Separator(),
177-
{ value: 'main', name: 'Go Back to Main Menu' }
177+
{ value: 'main', name: 'Go Back to Main Menu' },
178178
];
179-
}
180-
}
179+
},
180+
},
181181
])
182182
.then((answers) => {
183183
switch (answers.pullAction) {

‎examples/redux/src/api/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import GitHubApi from 'github';
22

33
export default new GitHubApi({
44
headers: {
5-
'user-agent': 'Normalizr Redux Example'
6-
}
5+
'user-agent': 'Normalizr Redux Example',
6+
},
77
});

‎examples/redux/src/api/schema.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ export const commit = new schema.Entity(
66
'commits',
77
{
88
author: user,
9-
committer: user
9+
committer: user,
1010
},
1111
{ idAttribute: 'sha' }
1212
);
1313

1414
export const label = new schema.Entity('labels');
1515

1616
export const milestone = new schema.Entity('milestones', {
17-
creator: user
17+
creator: user,
1818
});
1919

2020
export const issue = new schema.Entity('issues', {
2121
assignee: user,
2222
assignees: [user],
2323
labels: [label],
2424
milestone,
25-
user
25+
user,
2626
});
2727

2828
export const pullRequest = new schema.Entity('pullRequests', {
2929
assignee: user,
3030
assignees: [user],
3131
labels: [label],
3232
milestone,
33-
user
33+
user,
3434
});
3535

3636
export const issueOrPullRequest = new schema.Array(
3737
{
3838
issues: issue,
39-
pullRequests: pullRequest
39+
pullRequests: pullRequest,
4040
},
4141
(entity) => (entity.pull_request ? 'pullRequests' : 'issues')
4242
);

‎examples/redux/src/redux/actions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export { setRepo } from './modules/repos';
88
export const ADD_ENTITIES = 'ADD_ENTITIES';
99
export const addEntities = (entities) => ({
1010
type: ADD_ENTITIES,
11-
payload: entities
11+
payload: entities,
1212
});

‎examples/redux/src/redux/modules/commits.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function reducer(state = {}, action) {
1010
case ADD_ENTITIES:
1111
return {
1212
...state,
13-
...action.payload.commits
13+
...action.payload.commits,
1414
};
1515

1616
default:
@@ -25,7 +25,7 @@ export const getCommits = ({ page = 0 } = {}) => (dispatch, getState, { api, sch
2525
return api.repos
2626
.getCommits({
2727
owner,
28-
repo
28+
repo,
2929
})
3030
.then((response) => {
3131
const data = normalize(response, [schema.commit]);

‎examples/redux/src/redux/modules/issues.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function reducer(state = {}, action) {
1010
case ADD_ENTITIES:
1111
return {
1212
...state,
13-
...action.payload.issues
13+
...action.payload.issues,
1414
};
1515

1616
default:
@@ -25,7 +25,7 @@ export const getIssues = ({ page = 0 } = {}) => (dispatch, getState, { api, sche
2525
return api.issues
2626
.getForRepo({
2727
owner,
28-
repo
28+
repo,
2929
})
3030
.then((response) => {
3131
const data = normalize(response, [schema.issue]);

‎examples/redux/src/redux/modules/labels.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function reducer(state = {}, action) {
1010
case ADD_ENTITIES:
1111
return {
1212
...state,
13-
...action.payload.labels
13+
...action.payload.labels,
1414
};
1515

1616
default:
@@ -25,7 +25,7 @@ export const getLabels = ({ page = 0 } = {}) => (dispatch, getState, { api, sche
2525
return api.issues
2626
.getLabels({
2727
owner,
28-
repo
28+
repo,
2929
})
3030
.then((response) => {
3131
const data = normalize(response, [schema.label]);

‎examples/redux/src/redux/modules/milestones.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function reducer(state = {}, action) {
1010
case ADD_ENTITIES:
1111
return {
1212
...state,
13-
...action.payload.milestones
13+
...action.payload.milestones,
1414
};
1515

1616
default:
@@ -25,7 +25,7 @@ export const getMilestones = ({ page = 0 } = {}) => (dispatch, getState, { api,
2525
return api.issues
2626
.getMilestones({
2727
owner,
28-
repo
28+
repo,
2929
})
3030
.then((response) => {
3131
const data = normalize(response, [schema.milestone]);

‎examples/redux/src/redux/modules/pull-requests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function reducer(state = {}, action) {
1010
case ADD_ENTITIES:
1111
return {
1212
...state,
13-
...action.payload.pullRequests
13+
...action.payload.pullRequests,
1414
};
1515

1616
default:
@@ -25,7 +25,7 @@ export const getPullRequests = ({ page = 0 } = {}) => (dispatch, getState, { api
2525
return api.pullRequests
2626
.getAll({
2727
owner,
28-
repo
28+
repo,
2929
})
3030
.then((response) => {
3131
const data = normalize(response, [schema.pullRequest]);

‎examples/redux/src/redux/modules/repos.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function reducer(state = {}, action) {
55
case Action.SET_REPO:
66
return {
77
...state,
8-
...action.payload
8+
...action.payload,
99
};
1010

1111
default:
@@ -14,14 +14,14 @@ export default function reducer(state = {}, action) {
1414
}
1515

1616
const Action = {
17-
SET_REPO: 'SET_REPO'
17+
SET_REPO: 'SET_REPO',
1818
};
1919

2020
export const setRepo = (slug) => {
2121
const [owner, repo] = slug.split('/');
2222
return {
2323
type: Action.SET_REPO,
24-
payload: { owner, repo }
24+
payload: { owner, repo },
2525
};
2626
};
2727

‎examples/redux/src/redux/modules/users.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default function reducer(state = {}, action) {
1212
...mergedUsers,
1313
[id]: {
1414
...(mergedUsers[id] || {}),
15-
...user
16-
}
15+
...user,
16+
},
1717
};
1818
}, state);
1919

‎examples/redux/src/redux/reducer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const reducer = combineReducers({
1414
[MILESTONES_STATE_KEY]: milestones,
1515
[PULLREQUESTS_STATE_KEY]: pullRequests,
1616
[REPO_STATE_KEY]: repos,
17-
[USERS_STATE_KEY]: users
17+
[USERS_STATE_KEY]: users,
1818
});
1919

2020
export default reducer;

0 commit comments

Comments
 (0)
Please sign in to comment.