From 2c6e55abf91daee793a901a8ea505200ac3ca5de Mon Sep 17 00:00:00 2001
From: Andre Wiggins <459878+andrewiggins@users.noreply.github.com>
Date: Fri, 3 Jan 2025 16:16:26 -0800
Subject: [PATCH] Upgrade prettier (#23)
---
.editorconfig | 15 +++++++++++++++
index.ts | 18 +++++++++---------
package-lock.json | 19 ++++++++++---------
package.json | 2 +-
src/events.ts | 10 +++++-----
src/normalizers.ts | 4 ++--
src/repos/airtable-metadata.ts | 6 +++---
src/repos/user-input.ts | 12 ++++++------
src/repos/website.ts | 12 ++++++------
src/speakers.ts | 8 ++++----
src/sponsors.ts | 8 ++++----
src/talks.ts | 10 +++++-----
test/normalizers.test.ts | 10 +++++-----
test/speakers.spec.ts | 16 ++++++++--------
test/talks.spec.ts | 34 +++++++++++++++++-----------------
15 files changed, 100 insertions(+), 84 deletions(-)
create mode 100644 .editorconfig
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..d9b274d
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,15 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[{package.json,package-lock.json,.*rc,*.yml,*.yaml}]
+indent_style = space
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/index.ts b/index.ts
index 008b367..c68e09b 100644
--- a/index.ts
+++ b/index.ts
@@ -60,15 +60,15 @@ const airtableBase = Airtable.base(airtableMetadata.baseId);
// load the airtable data we'll need
const airtableEvents = await getAirtableEvents(
airtableBase,
- airtableMetadata.eventsId
+ airtableMetadata.eventsId,
);
const airtableSpeakers = await getAirtableSpeakers(
airtableBase,
- airtableMetadata.speakersId
+ airtableMetadata.speakersId,
);
const airtableSponsors = await getAirtableSponsors(
airtableBase,
- airtableMetadata.sponsorsId
+ airtableMetadata.sponsorsId,
);
console.log("gathering existing website data...");
@@ -84,7 +84,7 @@ const websiteSponsors = await getWebsiteSponsors(config.seattlejsProjectPath);
// only used to prompt the user for which event they want to modify
const eventMap = mapAirtableEventsToWebsiteEvents(
airtableEvents,
- websiteEvents
+ websiteEvents,
);
const targetEvent = await getTargetEvent(eventMap);
@@ -95,19 +95,19 @@ if (!targetEvent.website) {
const { newPhotos, updatedSpeakers } = reconcileSpeakers(
targetEvent,
airtableSpeakers,
- websiteSpeakers
+ websiteSpeakers,
);
const { updatedTalks, removedTalks } = reconcileTalks(
targetEvent,
airtableSpeakers,
- websiteTalks
+ websiteTalks,
);
const { newLogos, updatedSponsors } = reconcileSponsors(
targetEvent,
airtableSponsors,
- websiteSponsors
+ websiteSponsors,
);
reconcileEvents(targetEvent, websiteEvents);
@@ -116,14 +116,14 @@ const confirmation = await confirmUpdate(
updatedSpeakers,
updatedTalks,
removedTalks,
- updatedSponsors
+ updatedSponsors,
);
if (confirmation) {
await exportData(websiteSpeakers, "speakers", config.seattlejsProjectPath);
const existingPhotos = await exportImages(
newPhotos,
"speakers",
- config.seattlejsProjectPath
+ config.seattlejsProjectPath,
);
await exportData(websiteTalks, "talks", config.seattlejsProjectPath);
diff --git a/package-lock.json b/package-lock.json
index e8698a9..a833f85 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -31,7 +31,7 @@
"eslint-plugin-promise": "^6.1.1",
"lodash": "^4.17.21",
"mocha": "^10.2.0",
- "prettier": "2.8.3",
+ "prettier": "^3.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
}
@@ -3693,15 +3693,16 @@
}
},
"node_modules/prettier": {
- "version": "2.8.3",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz",
- "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==",
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
+ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true,
+ "license": "MIT",
"bin": {
- "prettier": "bin-prettier.js"
+ "prettier": "bin/prettier.cjs"
},
"engines": {
- "node": ">=10.13.0"
+ "node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
@@ -7295,9 +7296,9 @@
"dev": true
},
"prettier": {
- "version": "2.8.3",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz",
- "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==",
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
+ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true
},
"process": {
diff --git a/package.json b/package.json
index b175bd7..57d3727 100644
--- a/package.json
+++ b/package.json
@@ -39,7 +39,7 @@
"eslint-plugin-promise": "^6.1.1",
"lodash": "^4.17.21",
"mocha": "^10.2.0",
- "prettier": "2.8.3",
+ "prettier": "^3.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
},
diff --git a/src/events.ts b/src/events.ts
index 04f675e..984a825 100644
--- a/src/events.ts
+++ b/src/events.ts
@@ -9,10 +9,10 @@ import {
/** mutates the events json data to include any event updates */
export const reconcileEvents = (
event: WebsiteAirtablePair,
- websiteEvents: WebsiteEvent[]
+ websiteEvents: WebsiteEvent[],
): void => {
const existingEventIndex = websiteEvents.findIndex(
- (webEvent) => webEvent.id == event.website.id
+ (webEvent) => webEvent.id == event.website.id,
);
if (existingEventIndex > 0) {
// the event exists, need to replace it with the updated one,
@@ -24,14 +24,14 @@ export const reconcileEvents = (
};
export const makeWebsiteEvent = (
- airtableEvent: Record