From 0ce686d0c13762a9ebc08e7185f2c16a36db042a Mon Sep 17 00:00:00 2001 From: liabru Date: Thu, 2 Feb 2017 00:17:01 +0000 Subject: [PATCH] fix lint --- .eslintrc | 1 + examples/broadphase.js | 1 - examples/gravity.js | 1 - examples/gyro.js | 1 - examples/mixed.js | 1 - examples/raycasting.js | 1 - examples/sleeping.js | 1 - examples/timescale.js | 1 - examples/views.js | 1 - src/geometry/Vector.js | 8 +++++--- 10 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.eslintrc b/.eslintrc index 923915c..63e3be3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,6 @@ { "rules": { + "no-fallthrough": 2, "no-console": 0, "no-unused-vars": 0, "indent": [ diff --git a/examples/broadphase.js b/examples/broadphase.js index 645832f..9a3725e 100644 --- a/examples/broadphase.js +++ b/examples/broadphase.js @@ -51,7 +51,6 @@ Example.broadphase = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(20, 30)); } - break; case 1: return Bodies.polygon(x, y, Math.round(Common.random(1, 8)), Common.random(20, 50)); diff --git a/examples/gravity.js b/examples/gravity.js index dbd53de..efd21dc 100644 --- a/examples/gravity.js +++ b/examples/gravity.js @@ -52,7 +52,6 @@ Example.gravity = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(20, 30)); } - break; case 1: return Bodies.polygon(x, y, Math.round(Common.random(1, 8)), Common.random(20, 50)); diff --git a/examples/gyro.js b/examples/gyro.js index d03822d..7d6b152 100644 --- a/examples/gyro.js +++ b/examples/gyro.js @@ -54,7 +54,6 @@ Example.gyro = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(25, 30), { chamfer: chamfer }); } - break; case 1: return Bodies.polygon(x, y, sides, Common.random(25, 50), { chamfer: chamfer }); } diff --git a/examples/mixed.js b/examples/mixed.js index c9ee647..a40a14c 100644 --- a/examples/mixed.js +++ b/examples/mixed.js @@ -54,7 +54,6 @@ Example.mixed = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(25, 30), { chamfer: chamfer }); } - break; case 1: return Bodies.polygon(x, y, sides, Common.random(25, 50), { chamfer: chamfer }); } diff --git a/examples/raycasting.js b/examples/raycasting.js index af45db0..a6d52c3 100644 --- a/examples/raycasting.js +++ b/examples/raycasting.js @@ -46,7 +46,6 @@ Example.raycasting = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(20, 30)); } - break; case 1: var sides = Math.round(Common.random(1, 8)); sides = (sides === 3) ? 4 : sides; diff --git a/examples/sleeping.js b/examples/sleeping.js index 0c6462c..528a982 100644 --- a/examples/sleeping.js +++ b/examples/sleeping.js @@ -53,7 +53,6 @@ Example.sleeping = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(20, 30)); } - break; case 1: return Bodies.polygon(x, y, Math.round(Common.random(1, 8)), Common.random(20, 50)); diff --git a/examples/timescale.js b/examples/timescale.js index 39fcd16..e18e6a4 100644 --- a/examples/timescale.js +++ b/examples/timescale.js @@ -109,7 +109,6 @@ Example.timescale = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(20, 30), bodyOptions); } - break; case 1: return Bodies.polygon(x, y, Math.round(Common.random(4, 8)), Common.random(20, 50), bodyOptions); diff --git a/examples/views.js b/examples/views.js index 47af314..d87c7a3 100644 --- a/examples/views.js +++ b/examples/views.js @@ -63,7 +63,6 @@ Example.views = function() { } else { return Bodies.rectangle(x, y, Common.random(80, 120), Common.random(20, 30)); } - break; case 1: var sides = Math.round(Common.random(1, 8)); sides = (sides === 3) ? 4 : sides; diff --git a/src/geometry/Vector.js b/src/geometry/Vector.js index c1d3688..0eaacdf 100644 --- a/src/geometry/Vector.js +++ b/src/geometry/Vector.js @@ -228,8 +228,10 @@ module.exports = Vector; * @type {vector[]} * @private */ - Vector._temp = [Vector.create(), Vector.create(), - Vector.create(), Vector.create(), - Vector.create(), Vector.create()]; + Vector._temp = [ + Vector.create(), Vector.create(), + Vector.create(), Vector.create(), + Vector.create(), Vector.create() + ]; })(); \ No newline at end of file