Skip to content

Commit d63aace

Browse files
committed
put semicolons on the end of lines like a normal person
1 parent 3b26a07 commit d63aace

22 files changed

+301
-301
lines changed

Diff for: .prettierrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"singleQuote": true,
44
"arrowParens": "avoid",
55
"bracketSpacing": false,
6-
"semi": false
6+
"semi": true
77
}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cheatsheet",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "A knowledge base for short snippets",
55
"main": "src/main.js",
66
"scripts": {

Diff for: src/client/App.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Vue from 'vue'
2-
import App from './App.vue'
1+
import Vue from 'vue';
2+
import App from './App.vue';
33

44
new Vue({
55
el: '#app',
66
render: h => h(App)
7-
})
7+
});

Diff for: src/main.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Library includes
2-
const {app, BrowserWindow, Menu} = require('electron')
2+
const {app, BrowserWindow, Menu} = require('electron');
33

44
// Custom infrastructure
5-
const menu = require('./server/menu')
6-
const routes = require('./server/routes')
7-
const api = require('./server/redis-api/api')
5+
const menu = require('./server/menu');
6+
const routes = require('./server/routes');
7+
const api = require('./server/redis-api/api');
88

99
function main() {
1010
// Set up redis API
11-
api.init()
11+
api.init();
1212

1313
// Set up routes
14-
routes.init()
14+
routes.init();
1515

1616
// Create main window
1717
let win = new BrowserWindow({
@@ -20,10 +20,10 @@ function main() {
2020
webPreferences: {
2121
nodeIntegration: true
2222
}
23-
})
24-
Menu.setApplicationMenu(menu)
25-
win.loadFile('src/client/index.html')
23+
});
24+
Menu.setApplicationMenu(menu);
25+
win.loadFile('src/client/index.html');
2626
}
2727

2828
// Start app
29-
app.on('ready', main)
29+
app.on('ready', main);

Diff for: src/server/add.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
const api = require('./redis-api')
1+
const api = require('./redis-api');
22

33
// Add to redis and send back success message to client
44
function snippetAdd(event, data) {
5-
console.log('add:')
6-
console.log(data)
5+
console.log('add:');
6+
console.log(data);
77

88
// Add snippet to the sheet
99
api.add(data).then(results => {
1010
event.sender.send('add-result', {
1111
status: 'success'
12-
})
13-
})
12+
});
13+
});
1414
}
1515

1616
module.exports = {
1717
add: snippetAdd
18-
}
18+
};

Diff for: src/server/drop.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const api = require('./redis-api')
1+
const api = require('./redis-api');
22

33
function snippetDrop(event, id) {
4-
console.log('drop: ' + id)
4+
console.log('drop: ' + id);
55

66
api.drop(id).then(result => {
77
event.sender.send('drop-result', {
88
status: 'success',
99
id: id
10-
})
11-
})
10+
});
11+
});
1212
}
1313

1414
module.exports = {
1515
drop: snippetDrop
16-
}
16+
};

Diff for: src/server/dropped.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
const api = require('./redis-api')
1+
const api = require('./redis-api');
22

33
function snippetsGet(event, data) {
4-
console.log('get:dropped:')
5-
console.log(data)
4+
console.log('get:dropped:');
5+
console.log(data);
66

77
// Get the dropped snippets
88
api.getDropped(data).then(snippets => {
9-
event.sender.send('get:dropped-result', snippets)
10-
})
9+
event.sender.send('get:dropped-result', snippets);
10+
});
1111
}
1212

1313
function snippetRestore(event, id) {
14-
console.log('restore: ' + id)
14+
console.log('restore: ' + id);
1515

1616
// Restore the snippet
1717
api.restore(id).then(result => {
1818
event.sender.send('restore-result', {
1919
status: 'success'
20-
})
21-
})
20+
});
21+
});
2222
}
2323

2424
function snippetDestroy(event, id) {
25-
console.log('destroy: ' + id)
25+
console.log('destroy: ' + id);
2626

2727
// Destroy the snippet
2828
api.destroy(id).then(result => {
2929
event.sender.send('destroy-result', {
3030
status: 'success'
31-
})
32-
})
31+
});
32+
});
3333
}
3434

3535
module.exports = {
3636
get: snippetsGet,
3737
restore: snippetRestore,
3838
destroy: snippetDestroy
39-
}
39+
};

Diff for: src/server/edit.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
const api = require('./redis-api')
1+
const api = require('./redis-api');
22

33
function get(event, id) {
4-
console.log('edit:get: ' + id)
4+
console.log('edit:get: ' + id);
55

66
api.get(id).then(snippet => {
7-
event.sender.send('edit:get-result', snippet)
8-
})
7+
event.sender.send('edit:get-result', snippet);
8+
});
99
}
1010

1111
function change(event, data) {
12-
console.log('edit:change:')
13-
console.log(data)
12+
console.log('edit:change:');
13+
console.log(data);
1414

1515
// Edit snippet
1616
api.edit(data.id, data).then(result => {
1717
event.sender.send('edit:change-result', {
1818
status: 'success'
19-
})
20-
})
19+
});
20+
});
2121
}
2222

2323
module.exports = {
2424
get: get,
2525
change: change
26-
}
26+
};

Diff for: src/server/get.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const api = require('./redis-api')
1+
const api = require('./redis-api');
22

33
// Get the snippet then send it to the client
44
function snippetGet(event, id) {
5-
console.log('get: ' + id)
5+
console.log('get: ' + id);
66

77
// Get the snippet
88
api.get(id).then(snippet => {
9-
event.sender.send('get-result', snippet)
10-
})
9+
event.sender.send('get-result', snippet);
10+
});
1111
}
1212

1313
module.exports = {
1414
get: snippetGet
15-
}
15+
};

Diff for: src/server/menu.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {Menu} = require('electron')
1+
const {Menu} = require('electron');
22

33
const menu = Menu.buildFromTemplate([
44
{
@@ -13,7 +13,7 @@ const menu = Menu.buildFromTemplate([
1313
{
1414
label: 'Dropped snippets',
1515
click(item, window) {
16-
window.webContents.send('menu:dropped')
16+
window.webContents.send('menu:dropped');
1717
}
1818
}
1919
]
@@ -31,6 +31,6 @@ const menu = Menu.buildFromTemplate([
3131
}
3232
]
3333
}
34-
])
34+
]);
3535

36-
module.exports = menu
36+
module.exports = menu;

Diff for: src/server/redis-api/add.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
const tokenizeHandler = require('./tokenize')
2-
const indexHandler = require('./index')
3-
const scoreHandler = require('./score')
1+
const tokenizeHandler = require('./tokenize');
2+
const indexHandler = require('./index');
3+
const scoreHandler = require('./score');
44

55
// Note: This function overwrites the id if data is there already
66
function simpleAdd(client, id, data) {
7-
let promise
7+
let promise;
88

99
// Store the snippet data
10-
promise = client.setAsync(id, JSON.stringify(data))
10+
promise = client.setAsync(id, JSON.stringify(data));
1111

12-
return promise
12+
return promise;
1313
}
1414

1515
// Get data -> tokenize -> index -> score
1616
function indexAndScore(client, id) {
17-
let promise
18-
let tokens
17+
let promise;
18+
let tokens;
1919

2020
// Get the tokenized snippet data
2121
promise = tokenizeHandler
2222
.tokenizeID(client, id)
2323

2424
// Index the tokens
2525
.then(snippetTokens => {
26-
tokens = snippetTokens
27-
return indexHandler.index(client, id, tokens)
26+
tokens = snippetTokens;
27+
return indexHandler.index(client, id, tokens);
2828
})
2929

3030
// Score the tokens
3131
.then(result => {
32-
return scoreHandler.score(client, tokens)
33-
})
32+
return scoreHandler.score(client, tokens);
33+
});
3434

35-
return promise
35+
return promise;
3636
}
3737

3838
// Get next ID -> simple add -> tokenize and score
3939
function fullAdd(client, data) {
40-
let promise
41-
let id
40+
let promise;
41+
let id;
4242

4343
// Get next ID
4444
promise = client
4545
.incrAsync('~~counter')
4646

4747
// Add
4848
.then(counter => {
49-
id = counter
50-
return simpleAdd(client, id, data)
49+
id = counter;
50+
return simpleAdd(client, id, data);
5151
})
5252

5353
// Tokenize it
5454
.then(result => {
55-
return indexAndScore(client, id)
56-
})
55+
return indexAndScore(client, id);
56+
});
5757

5858
// Return
59-
return promise
59+
return promise;
6060
}
6161

62-
module.exports.simpleAdd = simpleAdd
63-
module.exports.indexAndScore = indexAndScore
64-
module.exports.fullAdd = fullAdd
62+
module.exports.simpleAdd = simpleAdd;
63+
module.exports.indexAndScore = indexAndScore;
64+
module.exports.fullAdd = fullAdd;

0 commit comments

Comments
 (0)