Disallow spaces before anonymous/named function parens

This commit is contained in:
Alex Corn 2021-07-29 22:09:06 -04:00
parent e49c5c175e
commit e2ef03cc32
No known key found for this signature in database
GPG Key ID: E51989A3E7A27FDF
4 changed files with 7 additions and 5 deletions

View File

@ -26,7 +26,9 @@ module.exports = {
// Don't allow unused variables, but allow unused function args (e.g. in callbacks) and global vars
'no-unused-vars': ['error', {vars: 'local', args: 'none'}],
// Require using dot notation (obj.prop instead of obj['prop']) where possible
'dot-notation': 'error'
'dot-notation': 'error',
// Don't use spaces before parens in anonymous or named functions
'space-before-function-paren': ['error', {anonymous: 'never', named: 'never', asyncArrow: 'always'}]
// We will NOT be using eqeqeq for a few reasons:
// 1. I would have to go through and check every single `==` to make sure that it's not depending on loose equality checks.

View File

@ -91,7 +91,7 @@ function CMarketItem(appid, hashName, community, body, $) {
// TODO: Buying listings and placing buy orders
}
CMarketItem.prototype.updatePrice = function (currency, callback) {
CMarketItem.prototype.updatePrice = function(currency, callback) {
if (this.commodity) {
this.updatePriceForCommodity(currency, callback);
} else {
@ -142,7 +142,7 @@ CMarketItem.prototype.updatePriceForCommodity = function(currency, callback) {
}, 'steamcommunity');
};
CMarketItem.prototype.updatePriceForNonCommodity = function (currency, callback) {
CMarketItem.prototype.updatePriceForNonCommodity = function(currency, callback) {
if (this.commodity) {
throw new Error('Cannot update price for commodity item');
}

View File

@ -98,7 +98,7 @@ CSteamGroup.prototype.editEvent = function(id, name, type, description, time, se
this._community.editGroupEvent(this.steamID, id, name, type, description, time, server, callback);
};
CSteamGroup.prototype.deleteEvent = function (id, callback) {
CSteamGroup.prototype.deleteEvent = function(id, callback) {
this._community.deleteGroupEvent(this.steamID, id, callback);
};

View File

@ -17,7 +17,7 @@ SteamCommunity.prototype.getMarketApps = function(callback) {
let $ = Cheerio.load(body);
if ($('.market_search_game_button_group')) {
let apps = {};
$('.market_search_game_button_group a.game_button').each(function (i, element) {
$('.market_search_game_button_group a.game_button').each((i, element) => {
let e = Cheerio.load(element);
let name = e('.game_button_game_name').text().trim();
let url = element.attribs.href;