fix(prettier): Properly handle lint-stage files (#6970)

Now handles top level files and recursive files in folders.

Set max line length to be 100
This commit is contained in:
Diamond Lewis
2020-10-25 15:06:58 -05:00
committed by GitHub
parent c2f2281e6d
commit e6ac3b6932
178 changed files with 5585 additions and 10688 deletions

View File

@@ -57,10 +57,7 @@ export class PushQueue {
pushStatus: { objectId: pushStatus.objectId },
applicationId: config.applicationId,
};
this.parsePublisher.publish(
this.channel,
JSON.stringify(pushWorkItem)
);
this.parsePublisher.publish(this.channel, JSON.stringify(pushWorkItem));
skip += limit;
}
});

View File

@@ -48,14 +48,12 @@ export class PushWorker {
const where = utils.applyDeviceTokenExists(query.where);
delete query.where;
pushStatus = pushStatusHandler(config, pushStatus.objectId);
return rest
.find(config, auth, '_Installation', where, query)
.then(({ results }) => {
if (results.length == 0) {
return;
}
return this.sendToAdapter(body, results, pushStatus, config, UTCOffset);
});
return rest.find(config, auth, '_Installation', where, query).then(({ results }) => {
if (results.length == 0) {
return;
}
return this.sendToAdapter(body, results, pushStatus, config, UTCOffset);
});
}
sendToAdapter(
@@ -72,31 +70,20 @@ export class PushWorker {
const bodiesPerLocales = utils.bodiesPerLocales(body, locales);
// Group installations on the specified locales (en, fr, default etc...)
const grouppedInstallations = utils.groupByLocaleIdentifier(
installations,
locales
);
const grouppedInstallations = utils.groupByLocaleIdentifier(installations, locales);
const promises = Object.keys(grouppedInstallations).map(locale => {
const installations = grouppedInstallations[locale];
const body = bodiesPerLocales[locale];
return this.sendToAdapter(
body,
installations,
pushStatus,
config,
UTCOffset
);
return this.sendToAdapter(body, installations, pushStatus, config, UTCOffset);
});
return Promise.all(promises);
}
if (!utils.isPushIncrementing(body)) {
logger.verbose(`Sending push to ${installations.length}`);
return this.adapter
.send(body, installations, pushStatus.objectId)
.then(results => {
return pushStatus.trackSent(results, UTCOffset).then(() => results);
});
return this.adapter.send(body, installations, pushStatus.objectId).then(results => {
return pushStatus.trackSent(results, UTCOffset).then(() => results);
});
}
// Collect the badges to reduce the # of calls
@@ -107,13 +94,7 @@ export class PushWorker {
const payload = deepcopy(body);
payload.data.badge = parseInt(badge);
const installations = badgeInstallationsMap[badge];
return this.sendToAdapter(
payload,
installations,
pushStatus,
config,
UTCOffset
);
return this.sendToAdapter(payload, installations, pushStatus, config, UTCOffset);
});
return Promise.all(promises);
}

View File

@@ -88,10 +88,7 @@ export function groupByLocaleIdentifier(installations, locales = []) {
if (added) {
return;
}
if (
installation.localeIdentifier &&
installation.localeIdentifier.indexOf(locale) === 0
) {
if (installation.localeIdentifier && installation.localeIdentifier.indexOf(locale) === 0) {
added = true;
map[locale] = map[locale] || [];
map[locale].push(installation);