Skip to content

Commit fa8bad4

Browse files
authored
style: enable lint on CI (#9)
1 parent 64e37ab commit fa8bad4

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

index.js

+20-21
Original file line numberDiff line numberDiff line change
@@ -242,27 +242,27 @@ function isValidPostType (type) {
242242
return type >= exports.MSGTYPE_INSTANT && type <= exports.MSGTYPE_PERSIST
243243
}
244244

245-
function codeToError(code) {
245+
function codeToError (code) {
246246
var err
247247
switch (code) {
248-
case exports.ERROR_INVALID_PARAM:
249-
err = new Error('invalid params')
250-
break
251-
case exports.ERROR_NOT_CONNECTED:
252-
err = new Error('flora service not connected')
253-
break
254-
case exports.ERROR_TIMEOUT:
255-
err = new Error('flora call response timeout')
256-
break
257-
case exports.ERROR_TARGET_NOT_EXISTS:
258-
err = new Error('flora call target not exists')
259-
break
260-
case exports.ERROR_DUPLICATED_ID:
261-
err = new Error('flora client id duplicated')
262-
break
263-
default:
264-
err = new Error('unknown error code ' + code)
265-
break
248+
case exports.ERROR_INVALID_PARAM:
249+
err = new Error('invalid params')
250+
break
251+
case exports.ERROR_NOT_CONNECTED:
252+
err = new Error('flora service not connected')
253+
break
254+
case exports.ERROR_TIMEOUT:
255+
err = new Error('flora call response timeout')
256+
break
257+
case exports.ERROR_TARGET_NOT_EXISTS:
258+
err = new Error('flora call target not exists')
259+
break
260+
case exports.ERROR_DUPLICATED_ID:
261+
err = new Error('flora client id duplicated')
262+
break
263+
default:
264+
err = new Error('unknown error code ' + code)
265+
break
266266
}
267267
err.code = code
268268
return err
@@ -283,8 +283,7 @@ Agent.prototype.post = function (name, msg, type) {
283283
throw codeToError(exports.ERROR_INVALID_PARAM)
284284
}
285285
var r = this.nativePost(name, msg, type, isCaps(msg))
286-
if (r !== 0)
287-
throw codeToError(r)
286+
if (r !== 0) { throw codeToError(r) }
288287
return r
289288
}
290289

script/test

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -ex
33

4+
npx standard
5+
46
export LD_LIBRARY_PATH=$(pwd)/out/usr/lib
57
export DYLD_LIBRARY_PATH=$(pwd)/out/usr/lib
68

0 commit comments

Comments
 (0)