Skip to content

Commit 9ca21c1

Browse files
committed
fix lint issues
1 parent 5b0d34b commit 9ca21c1

8 files changed

Lines changed: 19 additions & 20 deletions

File tree

src/body/Body.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ var Axes = require('../geometry/Axes');
192192
}
193193

194194
for (property in settings) {
195-
196-
if (!settings.hasOwnProperty(property))
195+
if (!Object.prototype.hasOwnProperty.call(settings, property))
197196
continue;
198197

199198
value = settings[property];
@@ -1162,15 +1161,15 @@ var Axes = require('../geometry/Axes');
11621161
* @default 1
11631162
*/
11641163

1165-
/**
1164+
/**
11661165
* A `Number` that defines the offset in the x-axis for the sprite (normalised by texture width).
11671166
*
11681167
* @property render.sprite.xOffset
11691168
* @type number
11701169
* @default 0
11711170
*/
11721171

1173-
/**
1172+
/**
11741173
* A `Number` that defines the offset in the y-axis for the sprite (normalised by texture height).
11751174
*
11761175
* @property render.sprite.yOffset

src/body/Composite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ var Body = require('./Body');
440440
*/
441441
Composite.rebase = function(composite) {
442442
var objects = Composite.allBodies(composite)
443-
.concat(Composite.allConstraints(composite))
444-
.concat(Composite.allComposites(composite));
443+
.concat(Composite.allConstraints(composite))
444+
.concat(Composite.allComposites(composite));
445445

446446
for (var i = 0; i < objects.length; i++) {
447447
objects[i].id = Common.nextId();

src/body/World.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ var Common = require('../core/Common');
128128
* @return {world} The original world with the objects from composite added
129129
*/
130130

131-
/**
131+
/**
132132
* An alias for Composite.addBody
133133
* @method addBody
134134
* @param {world} world
135135
* @param {body} body
136136
* @return {world} The original world with the body added
137137
*/
138138

139-
/**
139+
/**
140140
* An alias for Composite.addConstraint
141141
* @method addConstraint
142142
* @param {world} world

src/factory/Bodies.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var Vector = require('../geometry/Vector');
4545
if (options.chamfer) {
4646
var chamfer = options.chamfer;
4747
rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius,
48-
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
48+
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
4949
delete options.chamfer;
5050
}
5151

@@ -91,7 +91,7 @@ var Vector = require('../geometry/Vector');
9191
if (options.chamfer) {
9292
var chamfer = options.chamfer;
9393
trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius,
94-
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
94+
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
9595
delete options.chamfer;
9696
}
9797

@@ -168,7 +168,7 @@ var Vector = require('../geometry/Vector');
168168
if (options.chamfer) {
169169
var chamfer = options.chamfer;
170170
polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius,
171-
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
171+
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
172172
delete options.chamfer;
173173
}
174174

src/factory/Composites.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ var Bodies = require('./Bodies');
217217
for (var i = 0; i < number; i++) {
218218
var separation = 1.9,
219219
circle = Bodies.circle(xx + i * (size * separation), yy + length, size,
220-
{ inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }),
220+
{ inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }),
221221
constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle });
222222

223223
Composite.addBody(newtonsCradle, circle);

src/geometry/Vertices.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var Common = require('../core/Common');
7070
* @return {vertices} vertices
7171
*/
7272
Vertices.fromPath = function(path, body) {
73-
var pathPattern = /L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/ig,
73+
var pathPattern = /L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,
7474
points = [];
7575

7676
path.replace(pathPattern, function(match, x, y) {

src/render/Render.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ var Mouse = require('../core/Mouse');
927927
// render a single axis indicator
928928
c.moveTo(part.position.x, part.position.y);
929929
c.lineTo((part.vertices[0].x + part.vertices[part.vertices.length-1].x) / 2,
930-
(part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2);
930+
(part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2);
931931
}
932932
}
933933
}
@@ -1227,9 +1227,9 @@ var Mouse = require('../core/Mouse');
12271227

12281228
var region = bucketId.split(/C|R/);
12291229
c.rect(0.5 + parseInt(region[1], 10) * grid.bucketWidth,
1230-
0.5 + parseInt(region[2], 10) * grid.bucketHeight,
1231-
grid.bucketWidth,
1232-
grid.bucketHeight);
1230+
0.5 + parseInt(region[2], 10) * grid.bucketHeight,
1231+
grid.bucketWidth,
1232+
grid.bucketHeight);
12331233
}
12341234

12351235
c.lineWidth = 1;
@@ -1276,7 +1276,7 @@ var Mouse = require('../core/Mouse');
12761276
bounds = item.bounds;
12771277
context.beginPath();
12781278
context.rect(Math.floor(bounds.min.x - 3), Math.floor(bounds.min.y - 3),
1279-
Math.floor(bounds.max.x - bounds.min.x + 6), Math.floor(bounds.max.y - bounds.min.y + 6));
1279+
Math.floor(bounds.max.x - bounds.min.x + 6), Math.floor(bounds.max.y - bounds.min.y + 6));
12801280
context.closePath();
12811281
context.stroke();
12821282

@@ -1310,7 +1310,7 @@ var Mouse = require('../core/Mouse');
13101310
bounds = inspector.selectBounds;
13111311
context.beginPath();
13121312
context.rect(Math.floor(bounds.min.x), Math.floor(bounds.min.y),
1313-
Math.floor(bounds.max.x - bounds.min.x), Math.floor(bounds.max.y - bounds.min.y));
1313+
Math.floor(bounds.max.x - bounds.min.x), Math.floor(bounds.max.y - bounds.min.y));
13141314
context.closePath();
13151315
context.stroke();
13161316
context.fill();

src/render/RenderPixi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ var Vector = require('../geometry/Vector');
485485

486486
primitive.moveTo(part.position.x - body.position.x, part.position.y - body.position.y);
487487
primitive.lineTo(((part.vertices[0].x + part.vertices[part.vertices.length-1].x) / 2 - body.position.x),
488-
((part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2 - body.position.y));
488+
((part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2 - body.position.y));
489489

490490
primitive.endFill();
491491
}

0 commit comments

Comments
 (0)