Skip to content

Commit 7459c60

Browse files
committed
refactor: format using prettier
1 parent 78a2587 commit 7459c60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+8505
-8794
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ typings/
6060

6161
# next.js build output
6262
.next
63+
64+
.npmrc

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"editor.defaultFormatter": "standard.vscode-standard",
3-
"standard.autoFixOnSave": true
3+
"standard.autoFixOnSave": true,
4+
"[javascript]": {
5+
"editor.defaultFormatter": "esbenp.prettier-vscode"
6+
}
47
}

package-lock.json

-5,494
This file was deleted.

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "app.js",
66
"scripts": {
77
"start": "node app.js",
8-
"lint": "standard",
9-
"lint:fix": "standard --fix",
8+
"lint": "prettier src/**/*.js",
9+
"lint:fix": "prettier --write src/**/*.js",
1010
"init-es": "node src/init-es.js",
1111
"init-db": "node src/init-db.js",
1212
"sync-es": "node src/scripts/sync-es.js",
@@ -35,9 +35,11 @@
3535
"mocha": "^6.1.4",
3636
"mocha-prepare": "^0.1.0",
3737
"nyc": "^14.0.0",
38-
"standard": "^12.0.1"
38+
"prettier": "^2.8.1"
3939
},
4040
"dependencies": {
41+
"@topcoder-framework/domain-challenge": "^0.1.1-ci.0",
42+
"@topcoder-framework/lib-common": "^0.1.1-ci.0",
4143
"aws-sdk": "^2.1145.0",
4244
"aws-xray-sdk": "^3.3.8",
4345
"axios": "^0.19.0",
@@ -76,9 +78,9 @@
7678
]
7779
},
7880
"engines": {
79-
"node": "10.x"
81+
"node": "18.x"
8082
},
8183
"volta": {
82-
"node": "12.22.12"
84+
"node": "18.12.1"
8385
}
8486
}

src/common/errors.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* This file defines application errors
33
*/
4-
const util = require('util')
4+
const util = require("util");
55

66
/**
77
* Helper function to create generic error object with http status code
@@ -10,31 +10,31 @@ const util = require('util')
1010
* @returns {Function} the error constructor
1111
* @private
1212
*/
13-
function createError (name, statusCode) {
13+
function createError(name, statusCode) {
1414
/**
1515
* The error constructor
1616
* @param {String} message the error message
1717
* @param {String} [cause] the error cause
1818
* @constructor
1919
*/
20-
function ErrorCtor (message, cause) {
21-
Error.call(this)
22-
Error.captureStackTrace(this)
23-
this.message = message || name
24-
this.cause = cause
25-
this.httpStatus = statusCode
20+
function ErrorCtor(message, cause) {
21+
Error.call(this);
22+
Error.captureStackTrace(this);
23+
this.message = message || name;
24+
this.cause = cause;
25+
this.httpStatus = statusCode;
2626
}
2727

28-
util.inherits(ErrorCtor, Error)
29-
ErrorCtor.prototype.name = name
30-
return ErrorCtor
28+
util.inherits(ErrorCtor, Error);
29+
ErrorCtor.prototype.name = name;
30+
return ErrorCtor;
3131
}
3232

3333
module.exports = {
34-
BadRequestError: createError('BadRequestError', 400),
35-
UnauthorizedError: createError('UnauthorizedError', 401),
36-
ForbiddenError: createError('ForbiddenError', 403),
37-
NotFoundError: createError('NotFoundError', 404),
38-
ConflictError: createError('ConflictError', 409),
39-
ServiceUnavailableError: createError('ServiceUnavailableError', 503)
40-
}
34+
BadRequestError: createError("BadRequestError", 400),
35+
UnauthorizedError: createError("UnauthorizedError", 401),
36+
ForbiddenError: createError("ForbiddenError", 403),
37+
NotFoundError: createError("NotFoundError", 404),
38+
ConflictError: createError("ConflictError", 409),
39+
ServiceUnavailableError: createError("ServiceUnavailableError", 503),
40+
};

0 commit comments

Comments
 (0)