From 47002dceffc95392cf5517fb9acbfb1641c64d70 Mon Sep 17 00:00:00 2001 From: virkt25 Date: Thu, 23 Aug 2018 22:09:45 -0400 Subject: [PATCH] style: fix linting --- .npmrc | 1 + lib/storage-handler.js | 18 ++++++++++++------ package.json | 6 +++--- 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/lib/storage-handler.js b/lib/storage-handler.js index 7bf21ab..114a48a 100644 --- a/lib/storage-handler.js +++ b/lib/storage-handler.js @@ -52,9 +52,11 @@ exports.upload = function(provider, req, res, options, cb) { self._fieldsSize += buffer.length; if (self._fieldsSize > self.maxFieldsSize) { self._error(new Error( - g.f('{{maxFieldsSize}} exceeded, received %s bytes of field data', + g.f( + '{{maxFieldsSize}} exceeded, received %s bytes of field data', self._fieldsSize - ))); + ) + )); return; } value += decoder.write(buffer); @@ -104,10 +106,12 @@ exports.upload = function(provider, req, res, options, cb) { if (Array.isArray(allowedContentTypes) && allowedContentTypes.length !== 0) { if (allowedContentTypes.indexOf(file.type) === -1) { self._error(new Error( - g.f('{{contentType}} "%s" is not allowed (Must be in [%s])', + g.f( + '{{contentType}} "%s" is not allowed (Must be in [%s])', file.type, allowedContentTypes.join(', ') - ))); + ) + )); return; } } @@ -203,10 +207,12 @@ exports.upload = function(provider, req, res, options, cb) { // - s3-upload-stream doesn't provide a way to do this in it's public interface // - We could call provider.delete file but it would not delete multipart data self._error(new Error( - g.f('{{maxFileSize}} exceeded, received %s bytes of field data (max is %s)', + g.f( + '{{maxFileSize}} exceeded, received %s bytes of field data (max is %s)', fileSize, maxFileSize - ))); + ) + )); return; } }); diff --git a/package.json b/package.json index 93ba6a2..f320949 100644 --- a/package.json +++ b/package.json @@ -20,10 +20,10 @@ "uuid": "^3.2.1" }, "devDependencies": { - "eslint": "^4.19.1", - "eslint-config-loopback": "^10.0.0", + "eslint": "^5.4.0", + "eslint-config-loopback": "^11.0.0", "express": "^4.16.3", - "loopback": "^3.20.0", + "loopback": "^3.22.1", "mkdirp": "^0.5.1", "mocha": "^5.2.0", "supertest": "^3.1.0",