Skip to content

Commit

Permalink
[Our415-317] Resolve all lint warnings (#263)
Browse files Browse the repository at this point in the history
* remove unused imports

* eslint-disable on email signup url

* remove unused StrapiAPI types

* add Options type and eslint-disable on requests line for simplicity
  • Loading branch information
adriencyberspace authored Nov 7, 2024
1 parent 0d6d094 commit 50a744a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
// https://support.google.com/analytics/answer/12938611#zippy=%2Cin-this-article
import ReactGA_4 from "react-ga4";
import { Helmet } from "react-helmet-async";
import { useLocation, useNavigate } from "react-router-dom";
import { useLocation } from "react-router-dom";
import {
GeoCoordinates,
getLocation,
Expand Down
2 changes: 2 additions & 0 deletions app/components/EmailSignup/Emailsignup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-script-url */

import React from "react";
import styles from "./EmailSignup.module.scss";
import { Button } from "components/ui/inline/Button/Button";
Expand Down
1 change: 0 additions & 1 deletion app/components/search/SearchResults/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { forwardRef } from "react";
import { TransformedSearchHit } from "models";
import { Link } from "react-router-dom";
import { LabelTag } from "components/ui/LabelTag";
import { Tooltip } from "react-tippy";
import { formatPhoneNumber, renderAddressMetadata } from "utils";
import { removeAsterisksAndHashes } from "utils/strings";
import ReactMarkdown from "react-markdown";
Expand Down
1 change: 0 additions & 1 deletion app/components/ui/SiteSearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FormEvent, useEffect, useState } from "react";
import cn from "classnames";
import { useClearRefinements, useSearchBox } from "react-instantsearch";
import styles from "./SiteSearchInput.module.scss";
import { useNavigate } from "react-router-dom";
Expand Down
19 changes: 0 additions & 19 deletions app/hooks/StrapiAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ interface BaseDatumAttributesResponse {
publishedAt?: string;
}

interface CategoryResponse extends BaseDatumAttributesResponse {
label: string;
}

export interface LinkResponse {
id: number;
url: string;
Expand Down Expand Up @@ -202,21 +198,6 @@ export interface ContentBlockResponse {
link: LinkResponse;
}

// this corresponds to the "Address" component in Strapi
interface AddressResponse {
id: number;
street: string;
zipcode: string;
geolocation: {
address: string;
geohash: string;
coordinates: {
lat: number;
lng: number;
};
} | null;
}

export interface FaqItem {
question: string;
answer: string;
Expand Down
1 change: 0 additions & 1 deletion app/pages/SearchResultsPage/SearchResultsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from "react";
import SearchResults from "components/search/SearchResults/SearchResults";
import Sidebar from "components/search/Sidebar/Sidebar";
import { Header } from "components/search/Header/Header";
import styles from "./SearchResultsPage.module.scss";
import { DEFAULT_AROUND_PRECISION, useAppContext } from "utils";
import { Configure } from "react-instantsearch-core";
Expand Down
8 changes: 7 additions & 1 deletion test/helpers/createSearchClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
interface SearchClientFacets {
categories: {
[category: string]: number;
};
}
interface Options {
[key: string]: any;
facets: SearchClientFacets;
}

/**
Expand Down Expand Up @@ -32,6 +37,7 @@ interface Options {
*/
export function createSearchClient(options: Options) {
return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
search: (requests: any) =>
Promise.resolve({
results: requests.map(() => ({
Expand Down

0 comments on commit 50a744a

Please sign in to comment.