Use eslint-plugin-import to bring some order to the mess (#132)

Fixes #130

Reviewed-on: www/www-new#132
Reviewed-by: dora <d43su@csclub.uwaterloo.ca>
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
amy-random-shapes
Aditya Thakral 1 year ago
parent 2031935ce4
commit 470a70d6b4
  1. 28
      .eslintrc.js
  2. 2
      components/Bubble.tsx
  3. 1
      components/Button.tsx
  4. 6
      components/ConnectWithUs.tsx
  5. 1
      components/DefaultLayout.tsx
  6. 4
      components/EmailSignup.tsx
  7. 5
      components/EventCard.tsx
  8. 6
      components/EventDescriptionCard.tsx
  9. 1
      components/EventSetting.tsx
  10. 4
      components/Footer.tsx
  11. 1
      components/Input.tsx
  12. 4
      components/Link.tsx
  13. 2
      components/MiniEventCard.tsx
  14. 3
      components/MiniTechTalkCard.tsx
  15. 4
      components/Navbar.tsx
  16. 1
      components/NewsCard.tsx
  17. 1
      components/OrganizedContent.tsx
  18. 1
      components/SocialLinks.tsx
  19. 4
      components/TeamMember.tsx
  20. 2
      components/TeamMemberCard.tsx
  21. 2
      components/TechTalkCard.tsx
  22. 61
      components/playground.tsx
  23. 2
      content/about/index.mdx
  24. 1324
      package-lock.json
  25. 1
      package.json
  26. 16
      pages/_app.tsx
  27. 11
      pages/about/index.tsx
  28. 5
      pages/about/our-supporters.tsx
  29. 9
      pages/get-involved.tsx
  30. 27
      pages/index.tsx
  31. 8
      pages/playground.mdx
  32. 2
      pages/resources/index.tsx
  33. 7
      pages/themer.tsx
  34. 3
      tsconfig.json

@ -9,6 +9,9 @@ module.exports = {
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:prettier/recommended",
],
@ -16,12 +19,37 @@ module.exports = {
rules: {
"prettier/prettier": "error",
"import/first": "error",
"import/order": [
"error",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true,
},
"pathGroups": [
{
"pattern": "@/**",
"group": "external",
"position": "after",
},
{
"pattern": "./*.css",
"group": "index",
"position": "after",
}
],
},
],
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
// Turn off these rules
"@typescript-eslint/explicit-module-boundary-types": "off",
"import/no-unresolved": "off",
},
settings: {
react: {

@ -1,5 +1,7 @@
import React from "react";
import { DefaultLayout } from "./DefaultLayout";
import styles from "./Bubble.module.css";
export default function Bubble(props: { children: React.ReactNode }) {

@ -1,4 +1,5 @@
import React, { AnchorHTMLAttributes, ButtonHTMLAttributes } from "react";
import styles from "./Button.module.css";
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {

@ -1,7 +1,9 @@
import React from "react";
import styles from "./ConnectWithUs.module.css";
import { SocialLinks } from "./SocialLinks";
import { Link } from "./Link";
import { SocialLinks } from "./SocialLinks";
import styles from "./ConnectWithUs.module.css";
export function ConnectWithUs() {
return (

@ -1,4 +1,5 @@
import React from "react";
import styles from "./DefaultLayout.module.css";
export function DefaultLayout(props: { children: React.ReactNode }) {

@ -1,8 +1,10 @@
import React from "react";
import styles from "./EmailSignup.module.css";
import { Button } from "./Button";
import { Input } from "./Input";
import styles from "./EmailSignup.module.css";
export function EmailSignup() {
return (
<section className={styles.container}>

@ -1,10 +1,11 @@
import React, { ReactNode } from "react";
import { Button } from "./Button";
import styles from "./EventCard.module.css";
import { Button } from "./Button";
import { EventSetting } from "./EventSetting";
import { Image } from "./Image";
import styles from "./EventCard.module.css";
interface EventCardProps {
name: string;
short: string;

@ -1,10 +1,12 @@
import React from "react";
import { Button } from "./Button";
import { Image } from "./Image";
import { EventSetting } from "./EventSetting";
import styles from "./EventDescriptionCard.module.css";
import { Image } from "./Image";
import { Discord, Twitch, Instagram, Facebook } from "./SocialLinks";
import styles from "./EventDescriptionCard.module.css";
interface Props {
name: string;
short: string;

@ -1,4 +1,5 @@
import React from "react";
import styles from "./EventSetting.module.css";
interface Props {

@ -1,7 +1,9 @@
import React from "react";
import styles from "./Footer.module.css";
import { SocialLinks } from "./SocialLinks";
import styles from "./Footer.module.css";
export function Footer() {
return (
<footer className={styles.footer}>

@ -1,4 +1,5 @@
import React, { InputHTMLAttributes } from "react";
import styles from "./Input.module.css";
export function Input(props: InputHTMLAttributes<HTMLInputElement>) {

@ -1,7 +1,7 @@
import NextLink, { LinkProps as NextLinkProps } from "next/link";
import React from "react";
import styles from "./Link.module.css";
import NextLink from "next/link";
import { LinkProps as NextLinkProps } from "next/link";
type Props = Omit<NextLinkProps, "href"> & { href: string };

@ -1,5 +1,7 @@
import React, { ReactNode } from "react";
import { EventSetting } from "./EventSetting";
import styles from "./MiniEventCard.module.css";
interface Props {

@ -1,6 +1,7 @@
import { DEFAULT_MIN_VERSION } from "node:tls";
import React from "react";
import { Image } from "./Image";
import styles from "./MiniTechTalkCard.module.css";
interface MiniTechTalkProps {

@ -1,7 +1,9 @@
import React, { useReducer } from "react";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useReducer } from "react";
import { Image } from "./Image";
import styles from "./Navbar.module.css";
type Menu = {

@ -1,4 +1,5 @@
import React, { ReactNode } from "react";
import styles from "./NewsCard.module.css";
interface NewsCardProps {

@ -1,4 +1,5 @@
import React, { ReactNode, ComponentType } from "react";
import styles from "./OrganizedContent.module.css";
export interface LinkProps {

@ -1,4 +1,5 @@
import React from "react";
import styles from "./SocialLinks.module.css";
interface Props {

@ -1,7 +1,9 @@
import React from "react";
import styles from "./TeamMember.module.css";
import { Image } from "./Image";
import styles from "./TeamMember.module.css";
interface TeamMemberProps {
name: string;
role: string;

@ -1,5 +1,7 @@
import React from "react";
import { Image } from "./Image";
import styles from "./TeamMemberCard.module.css";
interface TeamMemberCardProps {

@ -1,5 +1,7 @@
import React, { ReactNode } from "react";
import { Image } from "./Image";
import styles from "./TechTalkCard.module.css";
interface TechTalkProps {

@ -1,59 +1,56 @@
import React, { useState } from "react";
import styles from "./playground.module.css";
import AfterHoursContent, {
metadata as afterHoursMetadata,
} from "../content/playground/after-hours.event.mdx";
import OOTBReact, {
metadata as OOTBReactEventMetadata,
} from "../content/playground/ootb-react.event.mdx";
import AltTab, {
metadata as altTabEventMetadata,
} from "../content/playground/alt-tab.event.mdx";
import Name, {
metadata as nameOrganizedContentMetadata,
} from "../content/playground/constitution/name.section.mdx";
import Purpose, {
metadata as purposeOrganizedContentMetadata,
} from "../content/playground/constitution/purpose.section.mdx";
import Membership, {
metadata as membershipOrganizedContentMetadata,
} from "../content/playground/constitution/membership.section.mdx";
import Officers, {
metadata as officersOrganizedContentMetadata,
} from "../content/playground/constitution/officers.section.mdx";
import CodeyInfo, {
metadata as codeyMetadata,
} from "../content/playground/codey.team-member.mdx";
import Duties, {
metadata as dutiesOrganizedContentMetadata,
} from "../content/playground/constitution/duties-of-officers.section.mdx";
import ExecutiveCouncil, {
metadata as executiveCouncilOrganizedContentMetadata,
} from "../content/playground/constitution/executive-council.section.mdx";
import UnavailableContent, {
metadata as unavailableMetadata,
} from "../content/playground/unavailable.news.mdx";
import Membership, {
metadata as membershipOrganizedContentMetadata,
} from "../content/playground/constitution/membership.section.mdx";
import Name, {
metadata as nameOrganizedContentMetadata,
} from "../content/playground/constitution/name.section.mdx";
import Officers, {
metadata as officersOrganizedContentMetadata,
} from "../content/playground/constitution/officers.section.mdx";
import Purpose, {
metadata as purposeOrganizedContentMetadata,
} from "../content/playground/constitution/purpose.section.mdx";
import { metadata as dogeMetadata } from "../content/playground/doge.team-member.mdx";
import CodeyInfo, {
metadata as codeyMetadata,
} from "../content/playground/codey.team-member.mdx";
import OOTBReact, {
metadata as OOTBReactEventMetadata,
} from "../content/playground/ootb-react.event.mdx";
import TempTechTalk, {
metadata as tempTechTalkMetadata,
} from "../content/playground/temp.talk.mdx";
import UnavailableContent, {
metadata as unavailableMetadata,
} from "../content/playground/unavailable.news.mdx";
import { MiniEventCard } from "./MiniEventCard";
import { NewsCard } from "./NewsCard";
import { Link } from "./Link";
import { Button } from "./Button";
import { EventCard } from "./EventCard";
import { EventDescriptionCard } from "./EventDescriptionCard";
import { Link } from "./Link";
import { MiniEventCard } from "./MiniEventCard";
import { MiniTechTalkCard } from "./MiniTechTalkCard";
import { NewsCard } from "./NewsCard";
import { OrganizedContent, LinkProps } from "./OrganizedContent";
import { TeamMember } from "./TeamMember";
import { TeamMemberCard } from "./TeamMemberCard";
import { OrganizedContent, LinkProps } from "./OrganizedContent";
import { Button } from "./Button";
import { Footer } from "./Footer";
import { TechTalkCard } from "./TechTalkCard";
import { MiniTechTalkCard } from "./MiniTechTalkCard";
import styles from "./playground.module.css";
const events = [
{ Content: OOTBReact, metadata: OOTBReactEventMetadata },

@ -1,4 +1,4 @@
import Bubble from "./../../components/Bubble";
import Bubble from "@/components/Bubble";
<Bubble>

1324
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -34,6 +34,7 @@
"@typescript-eslint/parser": "4.28.4",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",

@ -1,12 +1,14 @@
import React, { ComponentType, ReactNode } from "react";
import { MDXProvider } from "@mdx-js/react";
import { NextComponentType, NextPageContext } from "next";
import { AppProps as DefaultAppProps } from "next/app";
import { MDXProvider } from "@mdx-js/react";
import { ThemeProvider } from "../components/Theme";
import { Navbar } from "../components/Navbar";
import { Footer } from "../components/Footer";
import { Link } from "../components/Link";
import { DefaultLayout } from "../components/DefaultLayout";
import React, { ComponentType, ReactNode } from "react";
import { DefaultLayout } from "@/components/DefaultLayout";
import { Footer } from "@/components/Footer";
import { Link } from "@/components/Link";
import { Navbar } from "@/components/Navbar";
import { ThemeProvider } from "@/components/Theme";
import styles from "./_app.module.css";
import "./_app.css";

@ -1,10 +1,13 @@
import React from "react";
import { Image } from "../../components/Image";
import { ConnectWithUs } from "@/components/ConnectWithUs";
import { DefaultLayout } from "@/components/DefaultLayout";
import { EmailSignup } from "@/components/EmailSignup";
import { Image } from "@/components/Image";
import Content from "../../content/about/index.mdx";
import styles from "./index.module.css";
import { ConnectWithUs } from "components/ConnectWithUs";
import { EmailSignup } from "components/EmailSignup";
import { DefaultLayout } from "components/DefaultLayout";
export default function AboutUs() {
return (

@ -1,6 +1,9 @@
import React from "react";
import { Image } from "../../components/Image";
import { Image } from "@/components/Image";
import Content from "../../content/about/our-supporters.mdx";
import styles from "./our-supporters.module.css";
export default function OurSupporters() {

@ -1,8 +1,11 @@
import React from "react";
import { Image } from "../components/Image";
import { ConnectWithUs } from "../components/ConnectWithUs";
import { EmailSignup } from "../components/EmailSignup";
import { ConnectWithUs } from "@/components/ConnectWithUs";
import { EmailSignup } from "@/components/EmailSignup";
import { Image } from "@/components/Image";
import Content from "../content/get-involved.mdx";
import styles from "./get-involved.module.css";
export default function GetInvolved() {

@ -1,24 +1,27 @@
import React from "react";
import { Image } from "../components/Image";
import { SocialLinks } from "../components/SocialLinks";
import { EventDescriptionCard } from "../components/EventDescriptionCard";
import { NewsCard } from "../components/NewsCard";
import { ConnectWithUs } from "../components/ConnectWithUs";
import { EmailSignup } from "../components/EmailSignup";
import { DefaultLayout } from "../components/DefaultLayout";
import styles from "./index.module.css";
// temporary event and news imports
import OOTBReact, {
metadata as OOTBReactEventMetadata,
} from "../content/playground/ootb-react.event.mdx";
import { ConnectWithUs } from "@/components/ConnectWithUs";
import { DefaultLayout } from "@/components/DefaultLayout";
import { EmailSignup } from "@/components/EmailSignup";
import { EventDescriptionCard } from "@/components/EventDescriptionCard";
import { Image } from "@/components/Image";
import { NewsCard } from "@/components/NewsCard";
import { SocialLinks } from "@/components/SocialLinks";
import AltTab, {
metadata as altTabEventMetadata,
} from "../content/playground/alt-tab.event.mdx";
import OOTBReact, {
metadata as OOTBReactEventMetadata,
} from "../content/playground/ootb-react.event.mdx";
import UnavailableContent, {
metadata as unavailableMetadata,
} from "../content/playground/unavailable.news.mdx";
import styles from "./index.module.css";
// temporary event and news imports
export default function Home() {
const events = [
{ Content: OOTBReact, metadata: OOTBReactEventMetadata },

@ -10,11 +10,11 @@ import {
ButtonDemo,
TechTalkDemo,
MiniTechTalkDemo,
} from "../components/playground";
import { ConnectWithUs } from "../components/ConnectWithUs";
import { EmailSignup } from "../components/EmailSignup";
} from "@/components/playground";
import { ConnectWithUs } from "@/components/ConnectWithUs";
import { EmailSignup } from "@/components/EmailSignup";
import { TeamMemberCard } from "../components/TeamMemberCard";
import { TeamMemberCard } from "@/components/TeamMemberCard";
# Playground

@ -1,5 +1,5 @@
import React from "react";
import Head from "next/head";
import React from "react";
export default function Resources() {
return (

@ -1,7 +1,8 @@
import React from "react";
import { useThemeContext, emptyPalette } from "components/Theme";
import { Input } from "components/Input";
import { Button } from "components/Button";
import { Button } from "@/components/Button";
import { Input } from "@/components/Input";
import { useThemeContext, emptyPalette } from "@/components/Theme";
import styles from "./themer.module.css";

@ -24,6 +24,9 @@
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"strictFunctionTypes": true,
"paths": {
"@/components/*": ["components/*"]
}
},
"include": [
"next-env.d.ts",

Loading…
Cancel
Save