Skip to content

Commit

Permalink
Fix analytics (#65)
Browse files Browse the repository at this point in the history
Uses the solution described in vercel/analytics#18 (comment) to fix eslint config, which removes the need for my eslint-ignore directive.

Also fixes some minor lint issues that leaked into codebase.
  • Loading branch information
elijahcarrel committed Mar 11, 2023
1 parent 182e436 commit bc29a6f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ["airbnb-typescript-prettier", "plugin:@next/next/recommended"],
extends: ["airbnb-typescript-prettier", "next"],
rules: {
"import/prefer-default-export": "off",
"react/jsx-props-no-spreading": "off",
Expand Down
4 changes: 3 additions & 1 deletion api/src/router/news-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export const typeDefs = gql`
export const resolvers = {
Query: {
getNews: async () => {
return NewsItem.find({ isPublished: true }).sort({ createTime: -1 }).exec();
return NewsItem.find({ isPublished: true })
.sort({ createTime: -1 })
.exec();
},
getNewsItem: async (_: any, args: { identifier: string }) => {
const { identifier } = args;
Expand Down
8 changes: 6 additions & 2 deletions api/src/service/email/comic-email-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ export const emailUsers = async (
options: EmailAllUsersOptions,
date: Moment,
) => {
const { sendAllComics = false, mentionNotUpdatedComics = true, includeLatestNewsItemEvenIfItsAlreadyBeenSent = false } = options;
const {
sendAllComics = false,
mentionNotUpdatedComics = true,
includeLatestNewsItemEvenIfItsAlreadyBeenSent = false,
} = options;
const populatedUsers: IUser[] = await User.populate(users, [
{
path: "syndications",
Expand All @@ -213,7 +217,7 @@ export const emailUsers = async (
// Find the most recent news item, or null if there was nothing within the last seven days.
const mostRecentNewsItem = await NewsItem.findOne({
createTime: {
$gte: date.subtract(7, 'days').toDate(),
$gte: date.subtract(7, "days").toDate(),
},
isPublished: true,
emailContent: { $exists: true, $ne: "" },
Expand Down
2 changes: 0 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {
import fetch from "isomorphic-unfetch";
import App from "next/app";
import React from "react";
// TODO(ecarrel): remove the eslint-disable directive once https://github.com/vercel/analytics/issues/18 is resolved.
// eslint-disable-next-line import/no-unresolved
import { Analytics } from "@vercel/analytics/react";
import { ToasterContainer } from "../common-components/ToasterContainer/ToasterContainer";

Expand Down

1 comment on commit bc29a6f

@vercel
Copy link

@vercel vercel bot commented on bc29a6f Mar 11, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.