fix and enforce indent rules
authorJustin Wind <justin.wind+git@gmail.com>
Sun, 8 Aug 2021 18:42:11 +0000 (11:42 -0700)
committerJustin Wind <justin.wind+git@gmail.com>
Mon, 9 Aug 2021 16:09:38 +0000 (09:09 -0700)
.eslintrc.json
CHANGELOG.md
lib/dingus.js
package.json
test/index.js
test/lib/dingus.js

index 7602b332d7b5a2ab2fe18bdd9faf9ed992475a66..1dc01d2438c77662ef4d54c0b839a9d0752c1e9d 100644 (file)
       "error",
       "last"
     ],
       "error",
       "last"
     ],
+    "indent": [
+      "warn",
+      2,
+      {
+        "SwitchCase": 1
+      }
+    ],
     "sonarjs/cognitive-complexity": "warn",
     "keyword-spacing": "error",
     "linebreak-style": [
     "sonarjs/cognitive-complexity": "warn",
     "keyword-spacing": "error",
     "linebreak-style": [
@@ -79,4 +86,4 @@
     "strict": "error",
     "vars-on-top": "error"
   }
     "strict": "error",
     "vars-on-top": "error"
   }
-}
\ No newline at end of file
+}
index 4b796d1bc50942e4856a16e1b375d98929ab9faf..8e0e33187309f285ff53f496d1edd6e1e3ca082e 100644 (file)
@@ -4,7 +4,7 @@ Releases and notable changes to this project are documented here.
 
 ## [Unreleased]
 
 
 ## [Unreleased]
 
-## [v1.1.0] - 
+## [v1.1.0] - 2021-08-08
 
 ### Added
 
 
 ### Added
 
@@ -20,4 +20,4 @@ Releases and notable changes to this project are documented here.
 
 [Unreleased]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=HEAD;hp=v1.1.0
 [v1.1.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.1.0;hp=v1.0.0
 
 [Unreleased]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=HEAD;hp=v1.1.0
 [v1.1.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.1.0;hp=v1.0.0
-[v1.0.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.0.0;hp=v0.0.0
\ No newline at end of file
+[v1.0.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.0.0;hp=v0.0.0
index 1cbfd72b8c95ad1d3fe3de38f7a1840349887a15..0143585c1d83732a9e064d2f8687596af88f42be 100644 (file)
@@ -274,7 +274,7 @@ class Dingus {
           default:
             this.logger.error(_scope, 'unknown dingus error', { error: e });
             handler = this.handlerInternalServerError.bind(this);
           default:
             this.logger.error(_scope, 'unknown dingus error', { error: e });
             handler = this.handlerInternalServerError.bind(this);
-          }
+        }
       } else if (e instanceof URIError) {
         handler = this.handlerBadRequest.bind(this);
       } else {
       } else if (e instanceof URIError) {
         handler = this.handlerBadRequest.bind(this);
       } else {
@@ -651,7 +651,7 @@ class Dingus {
    * @param {http.ServerResponse} res
    * @param {object} ctx
    */
    * @param {http.ServerResponse} res
    * @param {object} ctx
    */
-   async handlerBadRequest(req, res, ctx) {
+  async handlerBadRequest(req, res, ctx) {
     this.setResponseType(this.responseTypes, req, res, ctx);
     throw new ResponseError(Enum.ErrorResponse.BadRequest);
   }
     this.setResponseType(this.responseTypes, req, res, ctx);
     throw new ResponseError(Enum.ErrorResponse.BadRequest);
   }
@@ -662,7 +662,7 @@ class Dingus {
    * @param {http.ServerResponse} res
    * @param {object} ctx
    */
    * @param {http.ServerResponse} res
    * @param {object} ctx
    */
-   async handlerInternalServerError(req, res, ctx) {
+  async handlerInternalServerError(req, res, ctx) {
     this.setResponseType(this.responseTypes, req, res, ctx);
     throw new ResponseError(Enum.ErrorResponse.InternalServerError);
   }
     this.setResponseType(this.responseTypes, req, res, ctx);
     throw new ResponseError(Enum.ErrorResponse.InternalServerError);
   }
index 3b1199c59a476f1129bd6c4e843f055b096cc63c..450ee798fc34f8e60e82110fc441f5275ab13b05 100644 (file)
@@ -9,6 +9,7 @@
     "test": "mocha --recursive"
   },
   "pre-commit": [
     "test": "mocha --recursive"
   },
   "pre-commit": [
+    "eslint",
     "coverage"
   ],
   "engines": {
     "coverage"
   ],
   "engines": {
index 60753044dd55cbe8e6d4523b2d94995b0a3d1f69..922335dcca9f3ecfed405fc58dc3ca38cdbda6bf 100644 (file)
@@ -3,7 +3,6 @@
 'use strict';
 
 const assert = require('assert');
 'use strict';
 
 const assert = require('assert');
-const sinon = require('sinon'); // eslint-disable-line node/no-unpublished-require
 const apiDingus = require('..');
 
 
 const apiDingus = require('..');
 
 
index eeeaf3a8980bf17eb342833b0722721c96931905..60b0dad59d68ea21bfba45c759df89b5a7ccebe9 100644 (file)
@@ -552,7 +552,7 @@ describe('Dingus', function () {
       dingus.strictAccept = false;
       dingus.setResponseType(['my/type'], req, res, ctx);
       assert.strictEqual(ctx.responseType, 'my/type');
       dingus.strictAccept = false;
       dingus.setResponseType(['my/type'], req, res, ctx);
       assert.strictEqual(ctx.responseType, 'my/type');
-      });
+    });
 
   }); // setResponseType
 
 
   }); // setResponseType