Skip to content

Commit e1a82b6

Browse files
committed
Fixes trival warnings in eslint.
Signed-off-by: Eric Wang <[email protected]>
1 parent 4003229 commit e1a82b6

File tree

4 files changed

+30
-29
lines changed

4 files changed

+30
-29
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
},
77
"extends": "google",
88
"rules": {
9-
"key-spacing": [2, { "align": "value" }],
9+
"camelcase": [2, {properties: "never"}],
10+
"key-spacing": [2, {align: "value"}],
1011
"max-len": [1, 120],
1112
"no-eval": 1, // we use it on purpose
1213
"no-loop-func": 1,

lib/leetcode_client.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ function runCode(opts, problem, cb) {
290290

291291
opts.body = opts.body || {};
292292
_.extendOwn(opts.body, {
293-
'lang': h.extToLang(problem.file),
294-
'question_id': parseInt(problem.id, 10),
295-
'test_mode': false,
296-
'typed_code': h.getFileData(problem.file)
293+
lang: h.extToLang(problem.file),
294+
question_id: parseInt(problem.id, 10),
295+
test_mode: false,
296+
typed_code: h.getFileData(problem.file)
297297
});
298298

299299
requestWithReLogin(opts, function(e, resp, body) {
@@ -324,7 +324,7 @@ function runCode(opts, problem, cb) {
324324
leetcodeClient.testProblem = function(problem, cb) {
325325
var opts = makeOpts();
326326
opts.url = config.URL_TEST.replace('$slug', problem.slug);
327-
opts.body = {'data_input': problem.testcase};
327+
opts.body = {data_input: problem.testcase};
328328

329329
runCode(opts, problem, function(e, task) {
330330
if (e) return cb(e);
@@ -340,7 +340,7 @@ leetcodeClient.testProblem = function(problem, cb) {
340340
leetcodeClient.submitProblem = function(problem, cb) {
341341
var opts = makeOpts();
342342
opts.url = config.URL_SUBMIT.replace('$slug', problem.slug);
343-
opts.body = {'judge_type': 'large'};
343+
opts.body = {judge_type: 'large'};
344344

345345
runCode(opts, problem, function(e, task) {
346346
if (e) return cb(e);
@@ -357,8 +357,8 @@ leetcodeClient.starProblem = function(user, problem, starred, cb) {
357357
opts.method = 'POST';
358358
opts.json = true;
359359
opts.body = {
360-
'favorite_id_hash': user.hash,
361-
'question_id': problem.id
360+
favorite_id_hash: user.hash,
361+
question_id: problem.id
362362
};
363363
} else {
364364
opts.url = config.URL_FAVORITE_DELETE

test/test_core.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ describe('core', function() {
4343
var USER_AFTER_SAFE = {name: 'test-user', hash: 'abcdef'};
4444

4545
var FAVORITES = {
46-
'favorites': {
47-
'private_favorites': [{
48-
'id_hash': 'abcdef',
49-
'name': 'Favorite'
46+
favorites: {
47+
private_favorites: [{
48+
id_hash: 'abcdef',
49+
name: 'Favorite'
5050
}]
5151
}
5252
};

test/test_leetcode_client.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -472,25 +472,25 @@ describe('leetcode_client', function() {
472472
assert.equal(submissions.length, 20);
473473

474474
assert.deepEqual(submissions[0], {
475-
id: '95464136',
476-
title: 'Two Sum',
477-
'is_pending': false,
478-
lang: 'cpp',
479-
time: '1 month, 3 weeks',
480-
runtime: '12 ms',
481-
url: '/submissions/detail/95464136/',
482-
'status_display': 'Accepted'
475+
id: '95464136',
476+
title: 'Two Sum',
477+
is_pending: false,
478+
lang: 'cpp',
479+
time: '1 month, 3 weeks',
480+
runtime: '12 ms',
481+
url: '/submissions/detail/95464136/',
482+
status_display: 'Accepted'
483483
});
484484

485485
assert.deepEqual(submissions[1], {
486-
id: '78502271',
487-
title: 'Two Sum',
488-
'is_pending': false,
489-
lang: 'cpp',
490-
time: '6 months, 1 week',
491-
runtime: '13 ms',
492-
url: '/submissions/detail/78502271/',
493-
'status_display': 'Accepted'
486+
id: '78502271',
487+
title: 'Two Sum',
488+
is_pending: false,
489+
lang: 'cpp',
490+
time: '6 months, 1 week',
491+
runtime: '13 ms',
492+
url: '/submissions/detail/78502271/',
493+
status_display: 'Accepted'
494494
});
495495
done();
496496
});

0 commit comments

Comments
 (0)