Skip to content

Commit

Permalink
feat(lint): enforce NL before opening curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Jan 29, 2024
1 parent fc91778 commit 13b76ee
Show file tree
Hide file tree
Showing 26 changed files with 106 additions and 35 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
'/test/helpers',
],
rules: {
'brace-style': ['error', '1tbs'],
'class-methods-use-this': 'off',
'comma-dangle': ['error', {
arrays: 'always-multiline',
Expand Down
8 changes: 6 additions & 2 deletions src/definitions/behaviors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,9 @@
module.debug('Adding error state');
module.set.error();
if (module.should.removeError()) {
setTimeout(function () { module.remove.error(); }, settings.errorDuration);
setTimeout(function () {
module.remove.error();
}, settings.errorDuration);
}
}
module.debug('API Request failed', errorMessage, xhr);
Expand Down Expand Up @@ -971,7 +973,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/behaviors/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/behaviors/visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/globals/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/dimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
16 changes: 12 additions & 4 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,9 @@
module.set.filtered();
}
clearTimeout(module.timer);
module.timer = setTimeout(function () { module.search(); }, settings.delay.search);
module.timer = setTimeout(function () {
module.search();
}, settings.delay.search);
},
label: {
click: function (event) {
Expand Down Expand Up @@ -3749,12 +3751,16 @@
show: function () {
module.verbose('Delaying show event to ensure user intent');
clearTimeout(module.timer);
module.timer = setTimeout(function () { module.show(); }, settings.delay.show);
module.timer = setTimeout(function () {
module.show();
}, settings.delay.show);
},
hide: function () {
module.verbose('Delaying hide event to ensure user intent');
clearTimeout(module.timer);
module.timer = setTimeout(function () { module.hide(); }, settings.delay.hide);
module.timer = setTimeout(function () {
module.hide();
}, settings.delay.hide);
},
},

Expand Down Expand Up @@ -3880,7 +3886,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
8 changes: 6 additions & 2 deletions src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@
},
debounce: function (method, delay) {
clearTimeout(module.timer);
module.timer = setTimeout(function () { method(); }, delay);
module.timer = setTimeout(function () {
method();
}, delay);
},
keyboard: function (event) {
var
Expand Down Expand Up @@ -1273,7 +1275,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
8 changes: 6 additions & 2 deletions src/definitions/modules/nag.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
}

if (settings.displayTime > 0) {
setTimeout(function () { module.hide(); }, settings.displayTime);
setTimeout(function () {
module.hide();
}, settings.displayTime);
}
module.show();
},
Expand Down Expand Up @@ -377,7 +379,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
12 changes: 9 additions & 3 deletions src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@
;
clearTimeout(module.hideTimer);
if (!openedWithTouch || (openedWithTouch && settings.addTouchEvents)) {
module.showTimer = setTimeout(function () { module.show(); }, delay);
module.showTimer = setTimeout(function () {
module.show();
}, delay);
}
},
end: function () {
Expand All @@ -204,7 +206,9 @@
: settings.delay
;
clearTimeout(module.showTimer);
module.hideTimer = setTimeout(function () { module.hide(); }, delay);
module.hideTimer = setTimeout(function () {
module.hide();
}, delay);
},
touchstart: function (event) {
openedWithTouch = true;
Expand Down Expand Up @@ -1244,7 +1248,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
8 changes: 6 additions & 2 deletions src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@
callback = function () {
module.cancel.query();
module.remove.focus();
module.timer = setTimeout(function () { module.hideResults(); }, settings.hideDelay);
module.timer = setTimeout(function () {
module.hideResults();
}, settings.hideDelay);
}
;
if (pageLostFocus) {
Expand Down Expand Up @@ -1171,7 +1173,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 0);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 0);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down
8 changes: 6 additions & 2 deletions src/definitions/modules/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@
? ($allModules.length - index) * interval
: index * interval;
module.debug('Delaying animation by', delay);
setTimeout(function () { module.animate(); }, delay);
setTimeout(function () {
module.animate();
}, delay);
},

animate: function (overrideSettings) {
Expand Down Expand Up @@ -849,7 +851,9 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
module.performance.timer = setTimeout(function () {
module.performance.display();
}, 500);
},
display: function () {
var
Expand Down

0 comments on commit 13b76ee

Please sign in to comment.