Skip to content

Commit

Permalink
Fix some context sensitive lint disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
starwed committed Sep 23, 2018
1 parent b341b9a commit 3a1a606
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"unused": "vars",
"validthis": true,
"browser": true,
"node": true
"node": true,
"laxbreak": true
}
3 changes: 2 additions & 1 deletion src/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2309,10 +2309,11 @@ function clone(obj) {
// export Crafty
if (typeof define === "function") {
// AMD
// jshint ignore:start
define("crafty", [], function() {
// jshint ignore:line
return Crafty;
});
// jshint ignore:end
}

module.exports = Crafty;
7 changes: 3 additions & 4 deletions tests/unit/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,27 @@ Crafty.pause();
// Helper functions //
//////////////////////

// Disable jshint rules for setting global vars
// jshint -W020
resetStage = function() {
// jshint ignore:line
Crafty.viewport.reset();
Crafty.viewport.scroll("_x", 0);
Crafty.viewport.scroll("_y", 0);
Crafty.viewport.clampToEntities = true;
};

Round = function(x) {
// jshint ignore:line
return Math.round(x * 100) / 100;
};

keysUp = function() {
// jshint ignore:line
var keysToRelease = Array.prototype.slice.call(arguments);
for (var k in keysToRelease) {
var key = Crafty.keys[keysToRelease[k]] || keysToRelease[k];
Crafty.s("Keyboard").triggerKey("KeyUp", { eventName: "KeyUp", key: key });
}
};
keysDown = function() {
// jshint ignore:line
var keysToPress = Array.prototype.slice.call(arguments);
for (var k in keysToPress) {
var key = Crafty.keys[keysToPress[k]] || keysToPress[k];
Expand All @@ -59,6 +57,7 @@ keysDown = function() {
});
}
};
// jshint +W020

//////////////////
// QUnit config //
Expand Down

0 comments on commit 3a1a606

Please sign in to comment.