Skip to content

Commit

Permalink
Removing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NycoCC1993 committed Feb 12, 2024
1 parent b21e378 commit 5057b81
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client-course-schedulizer/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Footer, Header } from "components";
import { AboutPage, HarmonyPage, HelpPage, SchedulizerPage } from "components/pages";
import { AboutPage, HelpPage, SchedulizerPage } from "components/pages"; //Removed HarmonyPage importation
import React, { useReducer, useState } from "react";
import { HashRouter, Route, Switch } from "react-router-dom";
import { reducer, useLocal } from "utilities";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AddSectionButton, ColorSelector, Searchbar, SemesterSelector} from "components";
import { AddSectionButton, ColorSelector, SemesterSelector} from "components"; //Removed "Searchbar" from import
import React, { useContext } from "react";
import { AppContext } from "utilities/contexts";
import { SemesterPartSelector } from "../SemesterPartSelector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ interface TeamMemberProfile {
}

/* Display information about the Team Member */
export const TeamMemberProfile = ({ member }: TeamMemberProfile) => {
// Turned off "eslint/no-redeclare" and "eslint/no-unused-vars"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const TeamMemberProfile = ({ member }: TeamMemberProfile) => { // eslint-disable-line @typescript-eslint/no-redeclare
const { name, bio } = member;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface TextSection {
}

/* Display a header with content. Used on About Page */
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TextSection = ({ title, body }: TextSection) => {
return (
<Box mb={9} mt={3}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid } from "@material-ui/core";
//import { Grid } from "@material-ui/core";
import React from "react";
//import "../AboutPage/AboutPage.scss";
import { NewTabLink, Page } from "components/reuseables";
import { Page } from "components/reuseables"; //Removed "NewTabLink" import
import { TextSection } from "../AboutPage/.";

export const HelpPage = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface AddSectionButton extends ButtonProps {
isIcon?: boolean;
}

// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AddSectionButton = (props: AddSectionButton) => {
const { isIcon } = props;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface AsyncComponent {
const SubComponents = Union(Literal("Loading"), Literal("Loaded"));

// Some boiler plate to get useable types.
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
type SubComponents = Static<typeof SubComponents>;
type AsyncSubComponents = { [key in SubComponents]: FC<{}> };

Expand All @@ -30,6 +32,9 @@ type AsyncSubComponents = { [key in SubComponents]: FC<{}> };
- https://stackoverflow.com/a/56953600/9931154
- https://dev.to/shayanypn/buckle-with-react-sub-component-10ll
*/

// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AsyncComponent: FC<AsyncComponent> & AsyncSubComponents = ({
children,
isLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ interface GridItemAutocomplete {
}

/* A text field to be used on forms */
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GridItemAutocomplete = (
props: GridItemAutocomplete &
Omit<AutocompleteProps<unknown, boolean, boolean, boolean>, "renderInput">,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ interface GridItemCheckboxGroup {
options: string[];
}

// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GridItemCheckboxGroup = ({
label,
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface GridItemRadioGroup {

/* Renders a group of radio buttons for a form.
Ref: https://stackoverflow.com/questions/64042394/react-hook-form-and-material-ui-formcontrol */
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GridItemRadioGroup = ({
defaultValue,
label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ interface GridItemTextField {
}

/* A text field to be used on forms */
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GridItemTextField = ({ label, textFieldProps, value, name }: GridItemTextField) => {
const { register, errors } = useFormContext();
const { name: nameFallback, errorMessage } = useInput(label, errors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import React, { PropsWithChildren } from "react";
type NewTabLink = Pick<HTMLAnchorElement, "href">;

/* Opens a link in a new tab. Useful for referencing pages outside of the app */
export const NewTabLink = ({ children, href }: PropsWithChildren<NewTabLink>) => {
// Turned off "eslint/no-redeclare" and "eslint/no-unused-vars"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NewTabLink = ({ children, href }: PropsWithChildren<NewTabLink>) => { // eslint-disable-line @typescript-eslint/no-unused-vars
return (
<Link href={href} rel="noopener noreferrer" target="_blank">
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface PopoverButton extends ButtonProps {
popupId?: string;
}

// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PopoverButton = (props: PopoverButton) => {
const { isIcon, popupId, buttonTitle, minWidth, children, ...buttonProps } = props;
const popupState = usePopupState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface AnimateShowAndHide {
- https://codesandbox.io/embed/zn2q57vn13
- https://stackoverflow.com/questions/56928771/reactjs-react-countup-visible-only-once-in-visibility-sensor
*/
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AnimateShowAndHide = ({ children, once }: PropsWithChildren<AnimateShowAndHide>) => {
const [isActive, setIsActive] = useState(true);
const [isVisible, setIsVisible] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ enum Term {
and a dispatcher to perform updates against the
state of the app.
*/
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AppContext = createContext<AppContext>({
appDispatch: voidFn,
appState: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface ScheduleContext {
}

/* Provide a context for each Schedule (Faculty, Room, etc.) */
// Turned off "eslint/no-redeclare"
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ScheduleContext = createContext<ScheduleContext>({
isScheduleLoading: false,
setIsScheduleLoading: voidFn,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadLocal } from "utilities/hooks/useLocal";
//import { loadLocal } from "utilities/hooks/useLocal";
import { HarmonyClass } from "utilities/services";
import { Schedule, SemesterLength, Term } from "./dataInterfaces";

Expand Down

0 comments on commit 5057b81

Please sign in to comment.