Skip to content

Commit 54cecac

Browse files
committed
File cleanup + lint fixes.
1 parent 0d59927 commit 54cecac

24 files changed

+127
-129
lines changed

docs/sass/materialize.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
@import "components/slider";
3636
@import "components/date_picker/default.scss";
3737
@import "components/date_picker/default.date.scss";
38-
@import "components/date_picker/default.time.scss";
38+
@import "components/date_picker/default.time.scss";

examples/flux-chat/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ At this point defined how our application manages state over time by creating an
187187

188188
Getters can take 2 forms:
189189

190-
1. A KeyPath such as `['messages']` which equates to a `state.getIn(['messages'])` on the app state `Immutable.Map`.
190+
1. A KeyPath such as `['messages']` which equates to a `state.getIn(['messages'])` on the app state `Immutable.Map`.
191191
2. An array with the form `[ [keypath | getter], [keypath | getter], ..., tranformFunction]`
192192

193193
##### `modules/chat/getters.js`

examples/flux-chat/js/mock-data.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = [
66
authorName: 'Bill',
77
text: 'Hey Jing, want to give a Flux talk at ForwardJS?',
88
isRead: false,
9-
timestamp: Date.now() - 99999
9+
timestamp: Date.now() - 99999,
1010
},
1111
{
1212
id: 'm_2',
@@ -15,7 +15,7 @@ module.exports = [
1515
authorName: 'Bill',
1616
text: 'Seems like a pretty cool conference.',
1717
isRead: false,
18-
timestamp: Date.now() - 89999
18+
timestamp: Date.now() - 89999,
1919
},
2020
{
2121
id: 'm_3',
@@ -24,7 +24,7 @@ module.exports = [
2424
authorName: 'Jing',
2525
text: 'Sounds good. Will they be serving dessert?',
2626
isRead: false,
27-
timestamp: Date.now() - 79999
27+
timestamp: Date.now() - 79999,
2828
},
2929
{
3030
id: 'm_4',
@@ -33,7 +33,7 @@ module.exports = [
3333
authorName: 'Bill',
3434
text: 'Hey Dave, want to get a beer after the conference?',
3535
isRead: false,
36-
timestamp: Date.now() - 69999
36+
timestamp: Date.now() - 69999,
3737
},
3838
{
3939
id: 'm_5',
@@ -42,7 +42,7 @@ module.exports = [
4242
authorName: 'Dave',
4343
text: 'Totally! Meet you at the hotel bar.',
4444
isRead: false,
45-
timestamp: Date.now() - 59999
45+
timestamp: Date.now() - 59999,
4646
},
4747
{
4848
id: 'm_6',
@@ -51,7 +51,7 @@ module.exports = [
5151
authorName: 'Bill',
5252
text: 'Hey Brian, are you going to be talking about functional stuff?',
5353
isRead: false,
54-
timestamp: Date.now() - 49999
54+
timestamp: Date.now() - 49999,
5555
},
5656
{
5757
id: 'm_7',
@@ -60,6 +60,6 @@ module.exports = [
6060
authorName: 'Brian',
6161
text: 'At ForwardJS? Yeah, of course. See you there!',
6262
isRead: false,
63-
timestamp: Date.now() - 39999
64-
}
63+
timestamp: Date.now() - 39999,
64+
},
6565
]

examples/flux-chat/js/modules/chat/actions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ exports.createMessage = function(text, threadID) {
2222
var id = 'm_' + timestamp
2323
var threadName = flux.evaluate([
2424
getters.threadsMap,
25-
threadsMap => threadsMap.getIn([threadID, 'threadName'])
25+
threadsMap => threadsMap.getIn([threadID, 'threadName']),
2626
])
2727
var authorName = 'Jordan'
2828

2929
flux.dispatch(actionTypes.ADD_MESSAGE, {
30-
message: { id, threadID, threadName, authorName, timestamp, text }
30+
message: { id, threadID, threadName, authorName, timestamp, text },
3131
})
3232
}
3333

examples/flux-chat/js/modules/chat/getters.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// it is idiomatic to facade all data access through getters, that way a component only has to subscribe to a getter making it agnostic
2-
// to the underyling stores / data transformation that is taking place
2+
// to the underlying stores / data transformation that is taking place
33
exports.threadsMap = ['threads']
44

55
exports.threads = [
66
exports.threadsMap,
7-
threadsMap => threadsMap.toList()
7+
threadsMap => threadsMap.toList(),
88
]
99

1010
exports.currentThread = [
1111
['currentThreadID'],
1212
exports.threadsMap,
13-
(currentThreadID, threadsMap) => threadsMap.get(currentThreadID)
13+
(currentThreadID, threadsMap) => threadsMap.get(currentThreadID),
1414
]
1515

1616
exports.latestThread = [
@@ -21,13 +21,13 @@ exports.latestThread = [
2121
thread.get('messages').last().get('timestamp')
2222
})
2323
.last()
24-
}
24+
},
2525
]
2626

2727

2828
exports.currentThreadID = [
2929
exports.currentThread,
30-
thread => thread ? thread.get('threadID') : null
30+
thread => thread ? thread.get('threadID') : null,
3131
]
3232

3333
exports.unreadCount = [
@@ -39,5 +39,5 @@ exports.unreadCount = [
3939
}
4040
return accum
4141
}, 0)
42-
}
42+
},
4343
]

examples/flux-chat/js/modules/chat/stores/current-thread-id-store.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var Nuclear = require('nuclear-js')
2-
var toImmutable = Nuclear.toImmutable
32
var actionTypes = require('../action-types')
43

54
module.exports = new Nuclear.Store({
@@ -11,7 +10,7 @@ module.exports = new Nuclear.Store({
1110
initialize() {
1211
// all action handlers are pure functions that take the current state and payload
1312
this.on(actionTypes.CLICK_THREAD, setCurrentThreadID)
14-
}
13+
},
1514
})
1615

1716
function setCurrentThreadID(state, { threadID }) {

examples/flux-chat/js/modules/chat/stores/thread-store.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = new Nuclear.Store({
1313
// all action handlers are pure functions that take the current state and payload
1414
this.on(actionTypes.ADD_MESSAGE, addMessage)
1515
this.on(actionTypes.CLICK_THREAD, setMessagesRead)
16-
}
16+
},
1717
})
1818

1919
/**

examples/flux-chat/webpack.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module.exports = {
77

88
output: {
99
path: './',
10-
filename: "[name].js",
10+
filename: '[name].js',
1111
},
1212

1313
module: {
1414
loaders: [
1515
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
1616
// required for react jsx
17-
{ test: /\.react.js$/, loader: "jsx-loader" },
18-
]
17+
{ test: /\.react.js$/, loader: 'jsx-loader' },
18+
],
1919
},
2020

2121
resolve: {

examples/rest-api/primer.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/rest-api/src/mock-server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var DATA = {
1616
name: 'jane',
1717
1818
},
19-
}
19+
},
2020
}
2121

2222
/**

examples/rest-api/src/modules/form/getters.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
var { Immutable } = require('nuclear-js')
2-
var User = require('../user')
32

43
exports.formExists = function(formId) {
54
return [
65
['form', formId],
7-
formEntry => !!formEntry
6+
formEntry => !!formEntry,
87
]
98
}
109

@@ -20,7 +19,7 @@ exports.isDirty = function(formId) {
2019
return [
2120
exports.initialValues(formId),
2221
exports.currentValues(formId),
23-
(initial, current) => !Immutable.is(initial, current)
22+
(initial, current) => !Immutable.is(initial, current),
2423
]
2524
}
2625

@@ -34,7 +33,7 @@ exports.dirtyFields = function(formId) {
3433
}
3534
return initial
3635
.map((val, key) => val !== current.get(key))
37-
}
36+
},
3837
]
3938
}
4039

examples/rest-api/src/modules/form/stores/form-store.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = new Nuclear.Store({
2525
function registerForm(state, { formId, initialValues }) {
2626
var formEntry = toImmutable({
2727
initialValues: initialValues,
28-
currentValues: initialValues
28+
currentValues: initialValues,
2929
})
3030
return state.set(formId, formEntry)
3131
}
@@ -42,7 +42,7 @@ function setFormValue(state, { formId, fieldName, value }) {
4242
var formEntry = state.get(formId)
4343

4444
if (!formEntry) {
45-
throw new Error("FormStore: cannot find form by formId=" + formId)
45+
throw new Error('FormStore: cannot find form by formId=' + formId)
4646
}
4747

4848
return state.setIn([formId, 'currentValues', fieldName], value)

examples/rest-api/src/modules/rest-api/coverage.html

+1-1
Large diffs are not rendered by default.

examples/rest-api/src/modules/rest-api/create-api-actions.js

-1
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,3 @@ function onDeleteFail(model, params, reason) {
161161
})
162162
return Promise.reject(reason)
163163
}
164-

examples/rest-api/src/modules/rest-api/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ exports.createEntityMapGetter = function(model) {
2626
// return an Immutable.Map for getters downstream
2727
if (!entityMap) {
2828
return toImmutable({})
29-
} else {
30-
return entityMap
3129
}
32-
}
30+
return entityMap
31+
},
3332
]
3433
}
3534

3635
/**
37-
* Creates a function that creates a getter that looks up the entity in the restApiCache by ID
36+
* Creates a function that creates a getter that looks up the entity in the restApiCache by ID
3837
* @param {Model} model
3938
*/
4039
exports.createByIdGetter = function(model) {

examples/rest-api/src/modules/rest-api/stores/rest-api-cache-store.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Stores cached entities for the Rest API
33
*/
4-
var _ = require('lodash');
4+
var _ = require('lodash')
55
var Nuclear = require('nuclear-js')
66
var toImmutable = Nuclear.toImmutable
77
var actionTypes = require('../action-types')
@@ -57,5 +57,5 @@ function removeData(state, payload) {
5757
// we assume that params is the instance with an `id` property
5858
var id = payload.params.id
5959

60-
return state.removeIn([entity, id]);
60+
return state.removeIn([entity, id])
6161
}

0 commit comments

Comments
 (0)