Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
{
"extends": ["next/core-web-vitals", "plugin:storybook/recommended"]
"env": {
"browser": true,
"es6": true,
"node": true
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config doesn't include any style-enforcing configs, do you think we should have something like that too? Otherwise formatting will have to still go to eslint, I suggest standardjs convention

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding style conventions to eslint will make it significantly slower & cause build breakage.

I think most styling could be handled by prettier.
We just need to better integrate prettier.
Currently it is only used to format the data JSON files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a blocker for now

"extends": [
"eslint:recommended",
"plugin:react/recommended",
"next",
"plugin:@next/next/recommended",
"plugin:storybook/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"react"
],
"settings": {
"react": {
"version": "detect"
}
}
}
4 changes: 0 additions & 4 deletions components/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function alert({ type, message }) {
<span>{message}</span>
</div>
);
break;
case "error":
return (
<div
Expand All @@ -25,7 +24,6 @@ export default function alert({ type, message }) {
<span>{message}</span>
</div>
);
break;
case "warning":
return (
<div
Expand All @@ -36,7 +34,6 @@ export default function alert({ type, message }) {
<span>{message}</span>
</div>
);
break;
case "info":
return (
<div
Expand All @@ -47,6 +44,5 @@ export default function alert({ type, message }) {
<span>{message}</span>
</div>
);
break;
}
}
2 changes: 0 additions & 2 deletions components/Button.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Link from "./Link";

export default function Button({
icon,
text,
primary = false,
disable,
children,
Expand Down
2 changes: 1 addition & 1 deletion components/form/DropDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export default function DropdownMenu({ eventType, handleEventTypeChange, options
</select>
</div>
);
};
}

1 change: 1 addition & 0 deletions components/map/Clusters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState } from "react";
import L from "leaflet";
import { Marker, useMap } from "react-leaflet";
import useSupercluster from "use-supercluster";
import UserMarker from "./UserMarker";
Expand Down
1 change: 0 additions & 1 deletion components/map/Map.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MapContainer, TileLayer } from "react-leaflet";
import Link from "@components/Link";
import Clusters from "./Clusters";
import "leaflet/dist/leaflet.css";

Expand Down
1 change: 1 addition & 0 deletions components/map/UserMarker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import L from "leaflet";
import { Marker, Popup } from "react-leaflet";
import { ReactMarkdown } from "react-markdown/lib/react-markdown";
import Link from "@components/Link";
Expand Down
4 changes: 2 additions & 2 deletions pages/api/auth/[...nextauth].js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const authOptions = {
strategy: "jwt",
},
callbacks: {
async redirect({ url, baseUrl }) {
async redirect({ baseUrl }) {
return `${baseUrl}/account/statistics`;
},
async jwt({ token, account, profile }) {
Expand All @@ -38,7 +38,7 @@ export const authOptions = {
}
return token;
},
async session({ session, token, user, profile }) {
async session({ session, token }) {
// Send properties to the client, like an access_token and user id from a provider.
session.accessToken = token.accessToken;
session.user.id = token.id;
Expand Down
2 changes: 1 addition & 1 deletion pages/api/auth/db-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { User, Account, Session, VerificationToken } from "@models/index"


/** @return { import("next-auth/adapters").Adapter } */
export default function DbAdapter(client, options = {}) {
export default function DbAdapter(client) {
return {
async createUser(data) {
await client();
Expand Down
4 changes: 1 addition & 3 deletions pages/api/discover/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export async function getTags(location = false) {
tags: { $exists: true },
"location.provided": {
$exists: true,
$ne: null,
$ne: "unknown",
$ne: "remote",
$nin: [null, "unknown", "remote"],
},
"location.name": { $ne: "unknown" },
},
Expand Down
2 changes: 1 addition & 1 deletion pages/api/profiles/[username]/links/[url].js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default async function handler(req, res) {
{ upsert: true }
);
} catch (e) {
logger.error(e, `failed incrementing platform stats for ${data}`);
logger.error(e, `failed incrementing platform stats for ${date}`);
}

return res.status(201).redirect(decodeURIComponent(url));
Expand Down
3 changes: 0 additions & 3 deletions pages/api/statistics/totals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import fs from "fs";
import path from "path";

import connectMongo from "@config/mongo";
import logger from "@config/logger";

Expand Down
8 changes: 6 additions & 2 deletions pages/api/system/reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,17 @@ function findOneByUsernameFull(data) {
});

data = { ...data, testimonials: allTestimonials };
} catch (e) {}
} catch (e) {
logger.error(e);
}

const filePathEvents = path.join(process.cwd(), "data", username, "events");
let eventFiles = [];
try {
eventFiles = fs.readdirSync(filePathEvents);
} catch (e) {}
} catch (e) {
logger.error(e);
}

const events = eventFiles.flatMap((filename) => {
try {
Expand Down
1 change: 0 additions & 1 deletion pages/auth/signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { signIn } from "next-auth/react";
import BlankLayout from "@components/layouts/BlankLayout";
import { authOptions } from "pages/api/auth/[...nextauth]";
import { BsGithub } from "react-icons/bs";
import { AiOutlineLock } from "react-icons/ai";
import Button from "@components/Button";
import Link from "@components/Link";

Expand Down
2 changes: 1 addition & 1 deletion pages/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EventTabs } from "@components/event/EventTabs";
import PageHead from "@components/PageHead";
import Badge from "@components/Badge";

export async function getServerSideProps(context) {
export async function getServerSideProps() {
let events = await getEvents();

return {
Expand Down
1 change: 0 additions & 1 deletion pages/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default function Playground({BASE_URL}) {
return true;
} catch (err) {
setErrMsg(err.toString());
setError(true);
setSuccessMsg("");
setShowNotification(true);
setTimeout(() => setShowNotification(false), 1500);
Expand Down