chore: Upgrade Prettier 1.8 -> 2.0 (#1436)

This commit is contained in:
Tom Moor
2020-08-08 18:53:11 -07:00
committed by GitHub
parent 68dcb4de5f
commit e312b264a6
218 changed files with 1156 additions and 1169 deletions

View File

@@ -13,7 +13,7 @@ export default class Backlinks {
const linkIds = parseDocumentIds(document.text);
await Promise.all(
linkIds.map(async linkId => {
linkIds.map(async (linkId) => {
const linkedDocument = await Document.findByPk(linkId);
if (linkedDocument.id === event.documentId) return;
@@ -53,7 +53,7 @@ export default class Backlinks {
// add any new backlinks that were created
await Promise.all(
addedLinkIds.map(async linkId => {
addedLinkIds.map(async (linkId) => {
const linkedDocument = await Document.findByPk(linkId);
if (linkedDocument.id === event.documentId) return;
@@ -71,7 +71,7 @@ export default class Backlinks {
// delete any backlinks that were removed
await Promise.all(
removedLinkIds.map(async linkId => {
removedLinkIds.map(async (linkId) => {
const document = await Document.findByPk(linkId, {
paranoid: false,
});
@@ -102,7 +102,7 @@ export default class Backlinks {
});
await Promise.all(
backlinks.map(async backlink => {
backlinks.map(async (backlink) => {
const previousUrl = `/doc/${slugify(previousRevision.title)}-${
document.urlId
}`;

View File

@@ -6,15 +6,14 @@ import path from "path";
const log = debug("services");
const services = {};
fs
.readdirSync(__dirname)
fs.readdirSync(__dirname)
.filter(
file =>
(file) =>
file.indexOf(".") !== 0 &&
file !== path.basename(__filename) &&
!file.includes(".test")
)
.forEach(fileName => {
.forEach((fileName) => {
const servicePath = path.join(__dirname, fileName);
const name = path.basename(servicePath.replace(/\.js$/, ""));
// $FlowIssue

View File

@@ -58,7 +58,7 @@ export default class Notifications {
const eventName =
event.name === "documents.publish" ? "published" : "updated";
notificationSettings.forEach(setting => {
notificationSettings.forEach((setting) => {
// For document updates we only want to send notifications if
// the document has been edited by the user with this notification setting
// This could be replaced with ability to "follow" in the future
@@ -111,7 +111,7 @@ export default class Notifications {
],
});
notificationSettings.forEach(setting =>
notificationSettings.forEach((setting) =>
mailer.collectionNotification({
to: setting.user.email,
eventName: "created",

View File

@@ -41,9 +41,7 @@ export default class Slack {
"Content-Type": "application/json",
},
body: JSON.stringify({
text: `👋 Hey there! When documents are published or updated in the *${
collection.name
}* collection on Outline they will be posted to this channel!`,
text: `👋 Hey there! When documents are published or updated in the *${collection.name}* collection on Outline they will be posted to this channel!`,
attachments: [
{
color: collection.color,

View File

@@ -127,7 +127,7 @@ export default class Websockets {
},
paranoid: false,
});
documents.forEach(document => {
documents.forEach((document) => {
socketio.to(`collection-${document.collectionId}`).emit("entities", {
event: event.name,
documentIds: [
@@ -138,7 +138,7 @@ export default class Websockets {
],
});
});
event.data.collectionIds.forEach(collectionId => {
event.data.collectionIds.forEach((collectionId) => {
socketio.to(`collection-${collectionId}`).emit("entities", {
event: event.name,
collectionIds: [{ id: collectionId }],