diff --git a/src/backend/database/database-wrapper.ts b/src/backend/database/database-wrapper.ts index 943c149..c96088c 100644 --- a/src/backend/database/database-wrapper.ts +++ b/src/backend/database/database-wrapper.ts @@ -1,4 +1,4 @@ -import { pgRead, pgReadWithReadCredentials, pgUpsert } from './pg-wrapper'; +import { pgRead, pgReadWithReadCredentials, pgUpsert } from "./pg-wrapper"; const dateUpToYear = () => new Date().toISOString().slice(0, 4); const dateUpToMonth = () => diff --git a/src/backend/database/pg-wrapper.ts b/src/backend/database/pg-wrapper.ts index 185da83..cfa91d5 100644 --- a/src/backend/database/pg-wrapper.ts +++ b/src/backend/database/pg-wrapper.ts @@ -1,8 +1,8 @@ -import pkg from 'pg'; +import pkg from "pg"; -import { platformNames } from '../platforms/all/platformNames'; -import { hash } from '../utils/hash'; -import { roughSizeOfObject } from '../utils/roughSize'; +import { platformNames } from "../platforms/all/platformNames"; +import { hash } from "../utils/hash"; +import { roughSizeOfObject } from "../utils/roughSize"; const { Pool } = pkg; diff --git a/src/backend/flow/doEverything.ts b/src/backend/flow/doEverything.ts index eabb4f1..47b50ae 100644 --- a/src/backend/flow/doEverything.ts +++ b/src/backend/flow/doEverything.ts @@ -1,8 +1,8 @@ -import { platformFetchers } from '../platforms/all-platforms'; -import { rebuildAlgoliaDatabase } from '../utils/algolia'; -import { updateHistory } from './history/updateHistory'; -import { mergeEverything } from './mergeEverything'; -import { rebuildNetlifySiteWithNewData } from './rebuildNetliftySiteWithNewData'; +import { platformFetchers } from "../platforms/all-platforms"; +import { rebuildAlgoliaDatabase } from "../utils/algolia"; +import { updateHistory } from "./history/updateHistory"; +import { mergeEverything } from "./mergeEverything"; +import { rebuildNetlifySiteWithNewData } from "./rebuildNetliftySiteWithNewData"; /* Do everything */ function sleep(ms) { diff --git a/src/backend/flow/doEverythingForScheduler.ts b/src/backend/flow/doEverythingForScheduler.ts index d2753d9..4b8e69f 100644 --- a/src/backend/flow/doEverythingForScheduler.ts +++ b/src/backend/flow/doEverythingForScheduler.ts @@ -1,3 +1,3 @@ -import { doEverything } from './doEverything'; +import { doEverything } from "./doEverything"; doEverything(); diff --git a/src/backend/flow/history/updateHistory.ts b/src/backend/flow/history/updateHistory.ts index 9caf1e0..b4733dc 100644 --- a/src/backend/flow/history/updateHistory.ts +++ b/src/backend/flow/history/updateHistory.ts @@ -1,4 +1,7 @@ -import { databaseReadWithReadCredentials, databaseUpsert } from '../../database/database-wrapper'; +import { + databaseReadWithReadCredentials, + databaseUpsert, +} from "../../database/database-wrapper"; export async function updateHistory() { let latest = await databaseReadWithReadCredentials({ group: "combined" }); diff --git a/src/backend/flow/mergeEverything.ts b/src/backend/flow/mergeEverything.ts index 4377bb3..ad06214 100644 --- a/src/backend/flow/mergeEverything.ts +++ b/src/backend/flow/mergeEverything.ts @@ -1,5 +1,5 @@ -import { databaseRead, databaseUpsert } from '../database/database-wrapper'; -import { platformNames } from '../platforms/all-platforms'; +import { databaseRead, databaseUpsert } from "../database/database-wrapper"; +import { platformNames } from "../platforms/all-platforms"; /* Merge everything */ diff --git a/src/backend/flow/rebuildNetliftySiteWithNewData.ts b/src/backend/flow/rebuildNetliftySiteWithNewData.ts index 7d4fe71..85edd16 100644 --- a/src/backend/flow/rebuildNetliftySiteWithNewData.ts +++ b/src/backend/flow/rebuildNetliftySiteWithNewData.ts @@ -1,6 +1,6 @@ -import axios from 'axios'; +import axios from "axios"; -import { applyIfSecretExists } from '../utils/getSecrets'; +import { applyIfSecretExists } from "../utils/getSecrets"; async function rebuildNetlifySiteWithNewData_inner(cookie) { let payload = {}; diff --git a/src/backend/frontpage.ts b/src/backend/frontpage.ts index 419a356..2ba4318 100644 --- a/src/backend/frontpage.ts +++ b/src/backend/frontpage.ts @@ -1,4 +1,4 @@ -import { pgRead, readWritePool } from './database/pg-wrapper'; +import { pgRead, readWritePool } from "./database/pg-wrapper"; export async function getFrontpageRaw() { const client = await readWritePool.connect(); diff --git a/src/backend/index.ts b/src/backend/index.ts index 0c1f686..2961419 100644 --- a/src/backend/index.ts +++ b/src/backend/index.ts @@ -1,16 +1,16 @@ /* Imports */ -import 'dotenv/config'; +import "dotenv/config"; -import readline from 'readline'; +import readline from "readline"; -import { pgInitialize } from './database/pg-wrapper'; -import { doEverything, tryCatchTryAgain } from './flow/doEverything'; -import { updateHistory } from './flow/history/updateHistory'; -import { mergeEverything } from './flow/mergeEverything'; -import { rebuildNetlifySiteWithNewData } from './flow/rebuildNetliftySiteWithNewData'; -import { rebuildFrontpage } from './frontpage'; -import { platformFetchers } from './platforms/all-platforms'; -import { rebuildAlgoliaDatabase } from './utils/algolia'; +import { pgInitialize } from "./database/pg-wrapper"; +import { doEverything, tryCatchTryAgain } from "./flow/doEverything"; +import { updateHistory } from "./flow/history/updateHistory"; +import { mergeEverything } from "./flow/mergeEverything"; +import { rebuildNetlifySiteWithNewData } from "./flow/rebuildNetliftySiteWithNewData"; +import { rebuildFrontpage } from "./frontpage"; +import { platformFetchers } from "./platforms/all-platforms"; +import { rebuildAlgoliaDatabase } from "./utils/algolia"; /* Support functions */ let functions = [ diff --git a/src/backend/manual/manualDownload.ts b/src/backend/manual/manualDownload.ts index f229616..d6422ab 100644 --- a/src/backend/manual/manualDownload.ts +++ b/src/backend/manual/manualDownload.ts @@ -1,8 +1,8 @@ -import 'dotenv/config'; +import "dotenv/config"; -import fs from 'fs'; +import fs from "fs"; -import { databaseReadWithReadCredentials } from '../database/database-wrapper'; +import { databaseReadWithReadCredentials } from "../database/database-wrapper"; let main = async () => { let json = await databaseReadWithReadCredentials({ group: "combined" }); diff --git a/src/backend/manual/manualInitialize.ts b/src/backend/manual/manualInitialize.ts index cdb1d09..1427013 100644 --- a/src/backend/manual/manualInitialize.ts +++ b/src/backend/manual/manualInitialize.ts @@ -1,3 +1,3 @@ -import { pgInitialize } from '../database/pg-wrapper'; +import { pgInitialize } from "../database/pg-wrapper"; pgInitialize(); diff --git a/src/backend/manual/manualSendToDb.ts b/src/backend/manual/manualSendToDb.ts index ff3ca2a..b66a747 100644 --- a/src/backend/manual/manualSendToDb.ts +++ b/src/backend/manual/manualSendToDb.ts @@ -1,6 +1,6 @@ -import fs from 'fs'; +import fs from "fs"; -import { databaseUpsert } from '../database/database-wrapper'; +import { databaseUpsert } from "../database/database-wrapper"; /* This is necessary for estimize, the database of x-risk estimates, and for the OpenPhil/GiveWell predictions. Unlike the others, I'm not fetching them constantly, but only once. */ diff --git a/src/backend/manual/pullSuperforecastsManually.ts b/src/backend/manual/pullSuperforecastsManually.ts index 8f64ca3..1a4829a 100644 --- a/src/backend/manual/pullSuperforecastsManually.ts +++ b/src/backend/manual/pullSuperforecastsManually.ts @@ -1,5 +1,5 @@ /* Imports */ -import { goodjudgment } from '../platforms/goodjudgment-fetch'; +import { goodjudgment } from "../platforms/goodjudgment-fetch"; /* Definitions */ diff --git a/src/backend/platforms/all/platformFetchers.ts b/src/backend/platforms/all/platformFetchers.ts index 5bf174f..04c1ce5 100644 --- a/src/backend/platforms/all/platformFetchers.ts +++ b/src/backend/platforms/all/platformFetchers.ts @@ -1,17 +1,17 @@ -import { betfair } from '../betfair-fetch'; -import { fantasyscotus } from '../fantasyscotus-fetch'; -import { foretold } from '../foretold-fetch'; -import { goodjudgment } from '../goodjudgment-fetch'; -import { goodjudgmentopen } from '../goodjudmentopen-fetch'; -import { infer } from '../infer-fetch'; -import { kalshi } from '../kalshi-fetch'; -import { manifoldmarkets } from '../manifoldmarkets-fetch'; -import { metaculus } from '../metaculus-fetch'; -import { polymarket } from '../polymarket-fetch'; -import { predictit } from '../predictit-fetch'; -import { rootclaim } from '../rootclaim-fetch'; -import { smarkets } from '../smarkets-fetch'; -import { wildeford } from '../wildeford-fetch'; +import { betfair } from "../betfair-fetch"; +import { fantasyscotus } from "../fantasyscotus-fetch"; +import { foretold } from "../foretold-fetch"; +import { goodjudgment } from "../goodjudgment-fetch"; +import { goodjudgmentopen } from "../goodjudmentopen-fetch"; +import { infer } from "../infer-fetch"; +import { kalshi } from "../kalshi-fetch"; +import { manifoldmarkets } from "../manifoldmarkets-fetch"; +import { metaculus } from "../metaculus-fetch"; +import { polymarket } from "../polymarket-fetch"; +import { predictit } from "../predictit-fetch"; +import { rootclaim } from "../rootclaim-fetch"; +import { smarkets } from "../smarkets-fetch"; +import { wildeford } from "../wildeford-fetch"; /* Deprecated import { astralcodexten } from "../platforms/astralcodexten-fetch" diff --git a/src/backend/platforms/example-fetch.ts b/src/backend/platforms/example-fetch.ts index ce1d05a..5e85051 100644 --- a/src/backend/platforms/example-fetch.ts +++ b/src/backend/platforms/example-fetch.ts @@ -1,8 +1,8 @@ /* Imports */ -import axios from 'axios'; +import axios from "axios"; -import { databaseUpsert } from '../database/database-wrapper'; -import { calculateStars } from '../utils/stars'; +import { databaseUpsert } from "../database/database-wrapper"; +import { calculateStars } from "../utils/stars"; /* Definitions */ let endpoint = "https://example.com/"; diff --git a/src/backend/platforms/fantasyscotus-fetch.ts b/src/backend/platforms/fantasyscotus-fetch.ts index bf08364..9ed3ff4 100644 --- a/src/backend/platforms/fantasyscotus-fetch.ts +++ b/src/backend/platforms/fantasyscotus-fetch.ts @@ -1,8 +1,8 @@ /* Imports */ -import axios from 'axios'; +import axios from "axios"; -import { databaseUpsert } from '../database/database-wrapper'; -import { calculateStars } from '../utils/stars'; +import { databaseUpsert } from "../database/database-wrapper"; +import { calculateStars } from "../utils/stars"; /* Definitions */ let unixtime = new Date().getTime(); diff --git a/src/backend/platforms/givewellopenphil-fetch.ts b/src/backend/platforms/givewellopenphil-fetch.ts index c8e3f70..85f2961 100644 --- a/src/backend/platforms/givewellopenphil-fetch.ts +++ b/src/backend/platforms/givewellopenphil-fetch.ts @@ -1,9 +1,9 @@ /* Imports */ -import axios from 'axios'; -import fs from 'fs'; +import axios from "axios"; +import fs from "fs"; -import { databaseUpsert } from '../database/database-wrapper'; -import { calculateStars } from '../utils/stars'; +import { databaseUpsert } from "../database/database-wrapper"; +import { calculateStars } from "../utils/stars"; /* Support functions */ async function fetchPage(url) { diff --git a/src/backend/platforms/goodjudgment-fetch.ts b/src/backend/platforms/goodjudgment-fetch.ts index e52d248..ace57cc 100644 --- a/src/backend/platforms/goodjudgment-fetch.ts +++ b/src/backend/platforms/goodjudgment-fetch.ts @@ -1,11 +1,11 @@ /* Imports */ -import axios from 'axios'; -import { Tabletojson } from 'tabletojson'; -import tunnel from 'tunnel'; +import axios from "axios"; +import { Tabletojson } from "tabletojson"; +import tunnel from "tunnel"; -import { databaseUpsert } from '../database/database-wrapper'; -import { hash } from '../utils/hash'; -import { calculateStars } from '../utils/stars'; +import { databaseUpsert } from "../database/database-wrapper"; +import { hash } from "../utils/hash"; +import { calculateStars } from "../utils/stars"; /* Definitions */ let endpoint = "https://goodjudgment.io/superforecasts/"; diff --git a/src/backend/platforms/goodjudmentopen-fetch.ts b/src/backend/platforms/goodjudmentopen-fetch.ts index a52f770..f09032f 100644 --- a/src/backend/platforms/goodjudmentopen-fetch.ts +++ b/src/backend/platforms/goodjudmentopen-fetch.ts @@ -1,11 +1,11 @@ /* Imports */ -import axios from 'axios'; -import { Tabletojson } from 'tabletojson'; +import axios from "axios"; +import { Tabletojson } from "tabletojson"; -import { databaseUpsert } from '../database/database-wrapper'; -import { applyIfSecretExists } from '../utils/getSecrets'; -import { calculateStars } from '../utils/stars'; -import toMarkdown from '../utils/toMarkdown'; +import { databaseUpsert } from "../database/database-wrapper"; +import { applyIfSecretExists } from "../utils/getSecrets"; +import { calculateStars } from "../utils/stars"; +import toMarkdown from "../utils/toMarkdown"; /* Definitions */ let htmlEndPoint = "https://www.gjopen.com/questions?page="; diff --git a/src/backend/platforms/infer-fetch.ts b/src/backend/platforms/infer-fetch.ts index b49b561..952ad76 100644 --- a/src/backend/platforms/infer-fetch.ts +++ b/src/backend/platforms/infer-fetch.ts @@ -1,11 +1,11 @@ /* Imports */ -import axios from 'axios'; -import { Tabletojson } from 'tabletojson'; +import axios from "axios"; +import { Tabletojson } from "tabletojson"; -import { databaseUpsert } from '../database/database-wrapper'; -import { applyIfSecretExists } from '../utils/getSecrets'; -import { calculateStars } from '../utils/stars'; -import toMarkdown from '../utils/toMarkdown'; +import { databaseUpsert } from "../database/database-wrapper"; +import { applyIfSecretExists } from "../utils/getSecrets"; +import { calculateStars } from "../utils/stars"; +import toMarkdown from "../utils/toMarkdown"; /* Definitions */ let htmlEndPoint = "https://www.infer-pub.com/questions"; diff --git a/src/backend/platforms/smarkets-fetch.ts b/src/backend/platforms/smarkets-fetch.ts index 579e66d..fdc234b 100644 --- a/src/backend/platforms/smarkets-fetch.ts +++ b/src/backend/platforms/smarkets-fetch.ts @@ -1,8 +1,8 @@ /* Imports */ -import axios from 'axios'; +import axios from "axios"; -import { databaseUpsert } from '../database/database-wrapper'; -import { calculateStars } from '../utils/stars'; +import { databaseUpsert } from "../database/database-wrapper"; +import { calculateStars } from "../utils/stars"; /* Definitions */ let htmlEndPointEntrance = "https://api.smarkets.com/v3/events/"; diff --git a/src/backend/platforms/wildeford-fetch.ts b/src/backend/platforms/wildeford-fetch.ts index 9814d8c..f3abace 100644 --- a/src/backend/platforms/wildeford-fetch.ts +++ b/src/backend/platforms/wildeford-fetch.ts @@ -1,11 +1,11 @@ /* Imports */ // import axios from "axios" -import { GoogleSpreadsheet } from 'google-spreadsheet'; +import { GoogleSpreadsheet } from "google-spreadsheet"; -import { databaseUpsert } from '../database/database-wrapper'; -import { applyIfSecretExists } from '../utils/getSecrets'; -import { hash } from '../utils/hash'; -import { calculateStars } from '../utils/stars'; +import { databaseUpsert } from "../database/database-wrapper"; +import { applyIfSecretExists } from "../utils/getSecrets"; +import { hash } from "../utils/hash"; +import { calculateStars } from "../utils/stars"; /* Definitions */ const SHEET_ID = "1xcgYF7Q0D95TPHLLSgwhWBHFrWZUGJn7yTyAhDR4vi0"; // spreadsheet key is the long id in the sheets URL diff --git a/src/backend/utils/algolia.ts b/src/backend/utils/algolia.ts index 8c76e47..a2bfec0 100644 --- a/src/backend/utils/algolia.ts +++ b/src/backend/utils/algolia.ts @@ -1,7 +1,7 @@ -import algoliasearch from 'algoliasearch'; +import algoliasearch from "algoliasearch"; -import { databaseReadWithReadCredentials } from '../database/database-wrapper'; -import { mergeEverythingInner } from '../flow/mergeEverything'; +import { databaseReadWithReadCredentials } from "../database/database-wrapper"; +import { mergeEverythingInner } from "../flow/mergeEverything"; let cookie = process.env.ALGOLIA_MASTER_API_KEY; const client = algoliasearch("96UD3NTQ7L", cookie); diff --git a/src/backend/utils/evaluations/pullForecastsToCSVForRating.ts b/src/backend/utils/evaluations/pullForecastsToCSVForRating.ts index 504f56a..944649d 100644 --- a/src/backend/utils/evaluations/pullForecastsToCSVForRating.ts +++ b/src/backend/utils/evaluations/pullForecastsToCSVForRating.ts @@ -1,7 +1,7 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; -import { databaseReadWithReadCredentials } from '../../database/database-wrapper'; +import { databaseReadWithReadCredentials } from "../../database/database-wrapper"; /* Definitions */ diff --git a/src/backend/utils/evaluations/pullMetaculusForecastsToCSVForRating.ts b/src/backend/utils/evaluations/pullMetaculusForecastsToCSVForRating.ts index 909410a..943852f 100644 --- a/src/backend/utils/evaluations/pullMetaculusForecastsToCSVForRating.ts +++ b/src/backend/utils/evaluations/pullMetaculusForecastsToCSVForRating.ts @@ -1,7 +1,7 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; -import { databaseReadWithReadCredentials } from '../../database/database-wrapper'; +import { databaseReadWithReadCredentials } from "../../database/database-wrapper"; /* Definitions */ diff --git a/src/backend/utils/hash.ts b/src/backend/utils/hash.ts index cb04b08..51ea1ab 100644 --- a/src/backend/utils/hash.ts +++ b/src/backend/utils/hash.ts @@ -1,4 +1,4 @@ -import crypto from 'crypto'; +import crypto from "crypto"; export const hash = (string: string) => crypto.createHash("sha256").update(string).digest("hex").slice(0, 10); diff --git a/src/backend/utils/misc/process-forecasts-from-old-givewellopenphil.ts b/src/backend/utils/misc/process-forecasts-from-old-givewellopenphil.ts index 4cbc51a..40ddd9e 100644 --- a/src/backend/utils/misc/process-forecasts-from-old-givewellopenphil.ts +++ b/src/backend/utils/misc/process-forecasts-from-old-givewellopenphil.ts @@ -1,5 +1,5 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; /* Definitions */ let locationData = "../../input"; diff --git a/src/backend/utils/misc/process-forecasts-from-old-xrisk.ts b/src/backend/utils/misc/process-forecasts-from-old-xrisk.ts index 705e4e1..aa53194 100644 --- a/src/backend/utils/misc/process-forecasts-from-old-xrisk.ts +++ b/src/backend/utils/misc/process-forecasts-from-old-xrisk.ts @@ -1,5 +1,5 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; /* Definitions */ let locationData = "../../data/"; diff --git a/src/backend/utils/misc/process-forecasts-from-xrisk.ts b/src/backend/utils/misc/process-forecasts-from-xrisk.ts index 09c9058..357bd78 100644 --- a/src/backend/utils/misc/process-forecasts-from-xrisk.ts +++ b/src/backend/utils/misc/process-forecasts-from-xrisk.ts @@ -1,5 +1,5 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; /* Definitions */ let locationData = "../../data/"; diff --git a/src/backend/utils/misc/process-forecasts-into-elicit.ts b/src/backend/utils/misc/process-forecasts-into-elicit.ts index 766974a..e423365 100644 --- a/src/backend/utils/misc/process-forecasts-into-elicit.ts +++ b/src/backend/utils/misc/process-forecasts-into-elicit.ts @@ -1,7 +1,7 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; -import { databaseReadWithReadCredentials } from '../../database/database-wrapper'; +import { databaseReadWithReadCredentials } from "../../database/database-wrapper"; /* Definitions */ let locationData = "./data/"; diff --git a/src/backend/utils/misc/process-forecasts-template.ts b/src/backend/utils/misc/process-forecasts-template.ts index cdb7dac..98323b4 100644 --- a/src/backend/utils/misc/process-forecasts-template.ts +++ b/src/backend/utils/misc/process-forecasts-template.ts @@ -1,5 +1,5 @@ /* Imports */ -import fs from 'fs'; +import fs from "fs"; /* Definitions */ let locationData = "./data/"; diff --git a/src/backend/utils/misc/test.ts b/src/backend/utils/misc/test.ts index 5118f15..b04ae43 100644 --- a/src/backend/utils/misc/test.ts +++ b/src/backend/utils/misc/test.ts @@ -1,4 +1,4 @@ -import axios from 'axios'; +import axios from "axios"; let elicitEndpoint = "https://elicit.org/api/v1/binary-questions/csv?binaryQuestions.resolved=false&binaryQuestions.search=&binaryQuestions.sortBy=popularity&predictors=community"; diff --git a/src/pages/api/all-forecasts.ts b/src/pages/api/all-forecasts.ts index d4a1bba..09e4668 100644 --- a/src/pages/api/all-forecasts.ts +++ b/src/pages/api/all-forecasts.ts @@ -1,6 +1,6 @@ -import { NextApiRequest, NextApiResponse } from 'next/types'; +import { NextApiRequest, NextApiResponse } from "next/types"; -import { getFrontpageFullRaw } from '../../backend/frontpage'; +import { getFrontpageFullRaw } from "../../backend/frontpage"; export default async function handler( req: NextApiRequest, diff --git a/src/pages/api/create-dashboard-from-ids.ts b/src/pages/api/create-dashboard-from-ids.ts index 110237a..3b06f27 100644 --- a/src/pages/api/create-dashboard-from-ids.ts +++ b/src/pages/api/create-dashboard-from-ids.ts @@ -1,7 +1,7 @@ -import crypto from 'crypto'; -import { NextApiRequest, NextApiResponse } from 'next/types'; +import crypto from "crypto"; +import { NextApiRequest, NextApiResponse } from "next/types"; -import { pgInsertIntoDashboard } from '../../backend/database/pg-wrapper'; +import { pgInsertIntoDashboard } from "../../backend/database/pg-wrapper"; export default async function handler( req: NextApiRequest, diff --git a/src/pages/api/dashboard-by-id.ts b/src/pages/api/dashboard-by-id.ts index 8a67c7c..e89d5c3 100644 --- a/src/pages/api/dashboard-by-id.ts +++ b/src/pages/api/dashboard-by-id.ts @@ -1,6 +1,6 @@ -import { NextApiRequest, NextApiResponse } from 'next/types'; +import { NextApiRequest, NextApiResponse } from "next/types"; -import { pgGetByIds } from '../../backend/database/pg-wrapper'; +import { pgGetByIds } from "../../backend/database/pg-wrapper"; export default async function handler( req: NextApiRequest, diff --git a/src/pages/api/frontpage.ts b/src/pages/api/frontpage.ts index 229464e..713ae95 100644 --- a/src/pages/api/frontpage.ts +++ b/src/pages/api/frontpage.ts @@ -1,6 +1,6 @@ -import { NextApiRequest, NextApiResponse } from 'next/types'; +import { NextApiRequest, NextApiResponse } from "next/types"; -import { getFrontpageRaw } from '../../backend/frontpage'; +import { getFrontpageRaw } from "../../backend/frontpage"; export default async function handler( req: NextApiRequest, diff --git a/src/pages/api/questions.ts b/src/pages/api/questions.ts index 4ea4ed0..4d925ad 100644 --- a/src/pages/api/questions.ts +++ b/src/pages/api/questions.ts @@ -1,6 +1,6 @@ -import { NextApiRequest, NextApiResponse } from 'next/types'; +import { NextApiRequest, NextApiResponse } from "next/types"; -import { pgRead } from '../../backend/database/pg-wrapper'; +import { pgRead } from "../../backend/database/pg-wrapper"; export default async function handler( req: NextApiRequest, diff --git a/src/pages/api/squiggle.ts b/src/pages/api/squiggle.ts index bd74b1a..76539a5 100644 --- a/src/pages/api/squiggle.ts +++ b/src/pages/api/squiggle.ts @@ -1,5 +1,5 @@ -import { NextApiRequest, NextApiResponse } from 'next/types'; -import { runMePlease } from 'squiggle-experimental/dist/index.js'; +import { NextApiRequest, NextApiResponse } from "next/types"; +import { runMePlease } from "squiggle-experimental/dist/index.js"; export default async function handler( req: NextApiRequest, diff --git a/src/pages/capture.tsx b/src/pages/capture.tsx index 0a7e4e6..279d86a 100644 --- a/src/pages/capture.tsx +++ b/src/pages/capture.tsx @@ -1,10 +1,10 @@ -import { NextPage } from 'next'; -import React from 'react'; +import { NextPage } from "next"; +import React from "react"; -import { displayForecastsWrapperForCapture } from '../web/display/displayForecastsWrappers'; -import Layout from '../web/display/layout'; -import { Props } from '../web/search/anySearchPage'; -import CommonDisplay from '../web/search/CommonDisplay'; +import { displayForecastsWrapperForCapture } from "../web/display/displayForecastsWrappers"; +import Layout from "../web/display/layout"; +import { Props } from "../web/search/anySearchPage"; +import CommonDisplay from "../web/search/CommonDisplay"; export { getServerSideProps } from "../web/search/anySearchPage"; diff --git a/src/pages/dashboards.tsx b/src/pages/dashboards.tsx index 4ec9098..26f7d8d 100644 --- a/src/pages/dashboards.tsx +++ b/src/pages/dashboards.tsx @@ -1,13 +1,13 @@ /* Imports */ -import axios from 'axios'; -import { GetServerSideProps } from 'next'; -import { useRouter } from 'next/router'; // https://nextjs.org/docs/api-reference/next/router -import { useState } from 'react'; +import axios from "axios"; +import { GetServerSideProps } from "next"; +import { useRouter } from "next/router"; // https://nextjs.org/docs/api-reference/next/router +import { useState } from "react"; -import { DashboardCreator } from '../web/display/dashboardCreator'; -import displayForecasts from '../web/display/displayForecasts'; -import Layout from '../web/display/layout'; -import { getDashboardForecastsByDashboardId } from '../web/worker/getDashboardForecasts'; +import { DashboardCreator } from "../web/display/dashboardCreator"; +import displayForecasts from "../web/display/displayForecasts"; +import Layout from "../web/display/layout"; +import { getDashboardForecastsByDashboardId } from "../web/worker/getDashboardForecasts"; /* get Props */ diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 0b0bb9d..e0db784 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,10 +1,10 @@ -import { NextPage } from 'next'; -import React from 'react'; +import { NextPage } from "next"; +import React from "react"; -import { displayForecastsWrapperForSearch } from '../web/display/displayForecastsWrappers'; -import Layout from '../web/display/layout'; -import { Props } from '../web/search/anySearchPage'; -import CommonDisplay from '../web/search/CommonDisplay'; +import { displayForecastsWrapperForSearch } from "../web/display/displayForecastsWrappers"; +import Layout from "../web/display/layout"; +import { Props } from "../web/search/anySearchPage"; +import CommonDisplay from "../web/search/CommonDisplay"; export { getServerSideProps } from "../web/search/anySearchPage"; diff --git a/src/pages/recursion.tsx b/src/pages/recursion.tsx index 6ab180a..91aac2a 100644 --- a/src/pages/recursion.tsx +++ b/src/pages/recursion.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect } from "react"; function Recursion() { useEffect(() => { diff --git a/src/pages/secretDashboard.tsx b/src/pages/secretDashboard.tsx index bcabe18..8fbb534 100644 --- a/src/pages/secretDashboard.tsx +++ b/src/pages/secretDashboard.tsx @@ -1,11 +1,11 @@ /* Imports */ // React -import { useRouter } from 'next/router'; // https://nextjs.org/docs/api-reference/next/router -import { useState } from 'react'; +import { useRouter } from "next/router"; // https://nextjs.org/docs/api-reference/next/router +import { useState } from "react"; -import displayForecasts from '../web/display/displayForecasts'; -import { getDashboardForecastsByDashboardId } from '../web/worker/getDashboardForecasts'; +import displayForecasts from "../web/display/displayForecasts"; +import { getDashboardForecastsByDashboardId } from "../web/worker/getDashboardForecasts"; /* get Props */ diff --git a/src/pages/secretEmbed.tsx b/src/pages/secretEmbed.tsx index 2af2f01..2a962ac 100644 --- a/src/pages/secretEmbed.tsx +++ b/src/pages/secretEmbed.tsx @@ -1,10 +1,10 @@ /* Imports */ -import React from 'react'; +import React from "react"; -import { displayForecast } from '../web/display/displayForecasts'; -import { platformsWithLabels } from '../web/platforms'; -import searchAccordingToQueryData from '../web/worker/searchAccordingToQueryData'; +import { displayForecast } from "../web/display/displayForecasts"; +import { platformsWithLabels } from "../web/platforms"; +import searchAccordingToQueryData from "../web/worker/searchAccordingToQueryData"; /* Helper functions */ diff --git a/src/pages/tools.tsx b/src/pages/tools.tsx index 1c105e6..d7e81fa 100644 --- a/src/pages/tools.tsx +++ b/src/pages/tools.tsx @@ -1,7 +1,7 @@ -import Link from 'next/link'; -import React from 'react'; +import Link from "next/link"; +import React from "react"; -import Layout from '../web/display/layout'; +import Layout from "../web/display/layout"; /* Display one tool */ function displayTool({ diff --git a/src/web/display/buttonsForStars.tsx b/src/web/display/buttonsForStars.tsx index a3e1a3d..471bea1 100644 --- a/src/web/display/buttonsForStars.tsx +++ b/src/web/display/buttonsForStars.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React from "react"; interface Props { onChange: (x: number) => void; diff --git a/src/web/display/dashboardCreator.tsx b/src/web/display/dashboardCreator.tsx index 13922d1..67779b2 100644 --- a/src/web/display/dashboardCreator.tsx +++ b/src/web/display/dashboardCreator.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState } from "react"; let exampleInput = `{ "title": "Random example", diff --git a/src/web/display/displayForecasts.tsx b/src/web/display/displayForecasts.tsx index a56c0bd..32d1ca7 100644 --- a/src/web/display/displayForecasts.tsx +++ b/src/web/display/displayForecasts.tsx @@ -1,7 +1,7 @@ /* Imports */ -import React from 'react'; -import { FaRegClipboard } from 'react-icons/fa'; -import ReactMarkdown from 'react-markdown'; +import React from "react"; +import { FaRegClipboard } from "react-icons/fa"; +import ReactMarkdown from "react-markdown"; /* Definitions */ diff --git a/src/web/display/displayForecastsWrappers.tsx b/src/web/display/displayForecastsWrappers.tsx index ca048bb..78ff574 100644 --- a/src/web/display/displayForecastsWrappers.tsx +++ b/src/web/display/displayForecastsWrappers.tsx @@ -1,5 +1,5 @@ -import displayForecasts from './displayForecasts'; -import displayOneForecast from './displayOneForecastForCapture'; +import displayForecasts from "./displayForecasts"; +import displayOneForecast from "./displayOneForecastForCapture"; export function displayForecastsWrapperForSearch({ results, diff --git a/src/web/display/displayOneForecastForCapture.tsx b/src/web/display/displayOneForecastForCapture.tsx index 793de87..147e621 100644 --- a/src/web/display/displayOneForecastForCapture.tsx +++ b/src/web/display/displayOneForecastForCapture.tsx @@ -1,9 +1,9 @@ -import domtoimage from 'dom-to-image'; // https://github.com/tsayen/dom-to-image -import { useEffect, useRef, useState } from 'react'; -import { CopyToClipboard } from 'react-copy-to-clipboard'; +import domtoimage from "dom-to-image"; // https://github.com/tsayen/dom-to-image +import { useEffect, useRef, useState } from "react"; +import { CopyToClipboard } from "react-copy-to-clipboard"; -import { uploadToImgur } from '../worker/uploadToImgur'; -import { displayForecast } from './displayForecasts'; +import { uploadToImgur } from "../worker/uploadToImgur"; +import { displayForecast } from "./displayForecasts"; function displayOneForecastInner(result, containerRef) { return ( diff --git a/src/web/display/form.tsx b/src/web/display/form.tsx index 3717f16..b9cc9cc 100644 --- a/src/web/display/form.tsx +++ b/src/web/display/form.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React from "react"; export default function Form({ value, onChange, placeholder }) { const handleInputChange = (event) => { diff --git a/src/web/display/layout.tsx b/src/web/display/layout.tsx index 7e1a567..240eeb9 100644 --- a/src/web/display/layout.tsx +++ b/src/web/display/layout.tsx @@ -1,8 +1,8 @@ -import Head from 'next/head'; -import Link from 'next/link'; -import React, { ErrorInfo } from 'react'; +import Head from "next/head"; +import Link from "next/link"; +import React, { ErrorInfo } from "react"; -import { Logo2 } from '../icons/index'; +import { Logo2 } from "../icons/index"; /* Utilities */ const classNameSelected = (isSelected: boolean) => diff --git a/src/web/display/multiSelectPlatforms.tsx b/src/web/display/multiSelectPlatforms.tsx index 7f9f358..23ac069 100644 --- a/src/web/display/multiSelectPlatforms.tsx +++ b/src/web/display/multiSelectPlatforms.tsx @@ -1,8 +1,8 @@ -import chroma from 'chroma-js'; -import React from 'react'; -import Select from 'react-select'; +import chroma from "chroma-js"; +import React from "react"; +import Select from "react-select"; -import { platformsWithLabels } from '../platforms'; +import { platformsWithLabels } from "../platforms"; const colourStyles = { control: (styles) => ({ ...styles, backgroundColor: "white" }), diff --git a/src/web/display/slider.tsx b/src/web/display/slider.tsx index 46ab60e..a3e9b1a 100644 --- a/src/web/display/slider.tsx +++ b/src/web/display/slider.tsx @@ -1,6 +1,6 @@ /* Imports */ -import React from 'react'; -import { Handles, Rail, Slider, Tracks } from 'react-compound-slider'; +import React from "react"; +import { Handles, Rail, Slider, Tracks } from "react-compound-slider"; // https://sghall.github.io/react-compound-slider/#/getting-started/tutorial diff --git a/src/web/icons/Favicon.tsx b/src/web/icons/Favicon.tsx index 4aba458..9bee8ac 100644 --- a/src/web/icons/Favicon.tsx +++ b/src/web/icons/Favicon.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import * as React from "react"; function SvgFavicon(props) { return ( diff --git a/src/web/icons/Logo.tsx b/src/web/icons/Logo.tsx index bcc38b2..0633163 100644 --- a/src/web/icons/Logo.tsx +++ b/src/web/icons/Logo.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import * as React from "react"; function SvgLogo(props) { return ( diff --git a/src/web/icons/Logo2.tsx b/src/web/icons/Logo2.tsx index d82808f..43709c6 100644 --- a/src/web/icons/Logo2.tsx +++ b/src/web/icons/Logo2.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import * as React from "react"; function SvgLogo2(props) { return ( diff --git a/src/web/search/CommonDisplay.tsx b/src/web/search/CommonDisplay.tsx index 1b47dbe..1190781 100644 --- a/src/web/search/CommonDisplay.tsx +++ b/src/web/search/CommonDisplay.tsx @@ -1,12 +1,18 @@ -import { useRouter } from 'next/router'; -import React, { DependencyList, EffectCallback, Fragment, useEffect, useState } from 'react'; +import { useRouter } from "next/router"; +import React, { + DependencyList, + EffectCallback, + Fragment, + useEffect, + useState, +} from "react"; -import ButtonsForStars from '../display/buttonsForStars'; -import Form from '../display/form'; -import MultiSelectPlatform from '../display/multiSelectPlatforms'; -import { SliderElement } from '../display/slider'; -import { platformsWithLabels, PlatformWithLabel } from '../platforms'; -import searchAccordingToQueryData from '../worker/searchAccordingToQueryData'; +import ButtonsForStars from "../display/buttonsForStars"; +import Form from "../display/form"; +import MultiSelectPlatform from "../display/multiSelectPlatforms"; +import { SliderElement } from "../display/slider"; +import { platformsWithLabels, PlatformWithLabel } from "../platforms"; +import searchAccordingToQueryData from "../worker/searchAccordingToQueryData"; interface QueryParametersWithoutNum { query: string; diff --git a/src/web/search/anySearchPage.tsx b/src/web/search/anySearchPage.tsx index eba9619..c38d770 100644 --- a/src/web/search/anySearchPage.tsx +++ b/src/web/search/anySearchPage.tsx @@ -1,8 +1,12 @@ -import { GetServerSideProps } from 'next'; +import { GetServerSideProps } from "next"; -import { getFrontpage } from '../../backend/frontpage'; -import searchAccordingToQueryData from '../worker/searchAccordingToQueryData'; -import { defaultNumDisplay, defaultQueryParameters, QueryParameters } from './CommonDisplay'; +import { getFrontpage } from "../../backend/frontpage"; +import searchAccordingToQueryData from "../worker/searchAccordingToQueryData"; +import { + defaultNumDisplay, + defaultQueryParameters, + QueryParameters, +} from "./CommonDisplay"; /* Common code for / and /capture */ diff --git a/src/web/worker/getDashboardForecasts.ts b/src/web/worker/getDashboardForecasts.ts index 96e0319..ab63b41 100644 --- a/src/web/worker/getDashboardForecasts.ts +++ b/src/web/worker/getDashboardForecasts.ts @@ -1,4 +1,4 @@ -import axios from 'axios'; +import axios from "axios"; export async function getDashboardForecastsByDashboardId({ dashboardId }) { console.log("getDashboardForecastsByDashboardId: "); diff --git a/src/web/worker/searchAccordingToQueryData.ts b/src/web/worker/searchAccordingToQueryData.ts index 7ebbdd6..7078ec9 100644 --- a/src/web/worker/searchAccordingToQueryData.ts +++ b/src/web/worker/searchAccordingToQueryData.ts @@ -1,5 +1,5 @@ -import searchGuesstimate from './searchGuesstimate'; -import searchWithAlgolia from './searchWithAlgolia'; +import searchGuesstimate from "./searchGuesstimate"; +import searchWithAlgolia from "./searchWithAlgolia"; export default async function searchAccordingToQueryData(queryData) { let results = []; diff --git a/src/web/worker/searchGuesstimate.ts b/src/web/worker/searchGuesstimate.ts index 1ddb3e5..944e520 100644 --- a/src/web/worker/searchGuesstimate.ts +++ b/src/web/worker/searchGuesstimate.ts @@ -1,5 +1,5 @@ /* Imports */ -import axios from 'axios'; +import axios from "axios"; /* Definitions */ let urlEndPoint = diff --git a/src/web/worker/searchWithAlgolia.ts b/src/web/worker/searchWithAlgolia.ts index 1c5955b..7d2ada5 100644 --- a/src/web/worker/searchWithAlgolia.ts +++ b/src/web/worker/searchWithAlgolia.ts @@ -1,4 +1,4 @@ -import algoliasearch from 'algoliasearch'; +import algoliasearch from "algoliasearch"; const client = algoliasearch("96UD3NTQ7L", "618dbd0092971388cfd43aac1ae5f1f5"); // Only search. const index = client.initIndex("metaforecast"); diff --git a/src/web/worker/uploadToImgur.ts b/src/web/worker/uploadToImgur.ts index 81fe3fe..c9581fc 100644 --- a/src/web/worker/uploadToImgur.ts +++ b/src/web/worker/uploadToImgur.ts @@ -1,5 +1,5 @@ // import fetch from "fetch" -import axios, { AxiosRequestConfig } from 'axios'; +import axios, { AxiosRequestConfig } from "axios"; export async function uploadToImgur(dataURL, handleGettingImgurlImage) { let request: AxiosRequestConfig = {