Skip to content

Commit

Permalink
feat: Linting, upgrade to ESLint 9, upgrade to Vite 6, other dependen…
Browse files Browse the repository at this point in the history
…cy upgrades
  • Loading branch information
mathhulk committed Nov 27, 2024
1 parent 40af3f2 commit 57b1950
Show file tree
Hide file tree
Showing 81 changed files with 4,501 additions and 4,867 deletions.
32 changes: 15 additions & 17 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"start": "tsx src/main.ts",
"dev": "tsx watch src/main.ts",
"build": "tsc --noEmit",
"lint": "eslint --ext .tsx,.ts src/ --report-unused-disable-directives",
"generate": "graphql-codegen --config codegen.ts",
"update:catalog": "tsx ./src/scripts/update-catalog.ts",
"update:grades": "tsx --env-file=.env ./src/scripts/update-grade-distributions.ts"
Expand All @@ -15,34 +14,33 @@
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@graphql-codegen/cli": "5.0.3",
"@graphql-codegen/graphql-modules-preset": "^4.0.11",
"@graphql-codegen/graphql-modules-preset": "^4.0.12",
"@graphql-codegen/introspection": "4.0.3",
"@graphql-codegen/typescript": "^4.1.1",
"@graphql-codegen/typescript-resolvers": "^4.4.0",
"@graphql-codegen/typescript": "^4.1.2",
"@graphql-codegen/typescript-resolvers": "^4.4.1",
"@repo/typescript-config": "*",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.17",
"@types/express-session": "^1.18.0",
"@types/express-session": "^1.18.1",
"@types/lodash": "^4.17.13",
"@types/node": "^22.9.1",
"@types/node": "^22.10.0",
"@types/passport-google-oauth20": "^2.0.16",
"eslint": "^9.15.0",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
"@types/papaparse": "^5.3.15",
"typescript": "^5.7.2"
},
"dependencies": {
"@apollo/server": "^4.11.2",
"@apollo/server-plugin-response-cache": "^4.1.3",
"@apollo/utils.keyvadapter": "^4.0.0",
"@aws-sdk/client-athena": "^3.696.0",
"@aws-sdk/client-s3": "^3.698.0",
"@escape.tech/graphql-armor": "^3.1.1",
"@graphql-tools/schema": "^10.0.8",
"@graphql-tools/utils": "^10.5.6",
"@keyv/redis": "^4.0.1",
"@aws-sdk/client-athena": "^3.699.0",
"@aws-sdk/client-s3": "^3.701.0",
"@escape.tech/graphql-armor": "^3.1.2",
"@graphql-tools/schema": "^10.0.10",
"@graphql-tools/utils": "^10.6.1",
"@keyv/redis": "^4.0.2",
"@repo/common": "*",
"@repo/sis-api": "*",
"@types/papaparse": "^5.3.15",
"compression": "^1.7.5",
"connect-redis": "^7.1.1",
"cors": "^2.8.5",
Expand All @@ -56,8 +54,8 @@
"helmet": "^8.0.0",
"keyv": "^5.2.1",
"lodash": "^4.17.21",
"mongodb": "^6.10.0",
"mongoose": "^8.8.2",
"mongodb": "^6.11.0",
"mongoose": "^8.8.3",
"papaparse": "^5.4.1",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"noEmit": true
},
"include": ["src"]
}
4 changes: 2 additions & 2 deletions apps/datapuller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"course": "tsx src/course.ts"
},
"devDependencies": {
"@types/node": "^22.9.1",
"@types/node": "^22.10.0",
"eslint": "^9.15.0",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"@repo/common": "*",
Expand Down
4 changes: 0 additions & 4 deletions apps/frontend/.eslintrc.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions apps/frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from "@repo/eslint-config/index.mjs";

export default [...config];
104 changes: 50 additions & 54 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,52 @@
{
"name": "frontend",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint --ext .tsx,.ts src/ --report-unused-disable-directives",
"start": "serve -s dist -p 3000"
},
"dependencies": {
"@apollo/client": "^3.11.10",
"@floating-ui/dom": "^1.6.12",
"@mapbox/mapbox-gl-directions": "^4.3.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.4",
"@repo/theme": "*",
"@shopify/draggable": "^1.1.3",
"@tanstack/react-virtual": "^3.10.9",
"classnames": "^2.5.1",
"fuse.js": "^7.0.0",
"graphql": "^16.9.0",
"iconoir-react": "^7.10.0",
"mapbox-gl": "^3.8.0",
"moment": "^2.30.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.28.0",
"recharts": "^2.13.3",
"sass-embedded": "^1.81.0"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@types/mapbox-gl": "^3.4.1",
"@types/node": "^22.9.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"eslint": "^9.15.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"sass": "^1.81.0",
"serve": "^14.2.4",
"typescript": "^5.6.3",
"vite": "^5.4.11"
}
"name": "frontend",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src/",
"start": "serve -s dist -p 3000"
},
"dependencies": {
"@apollo/client": "^3.11.10",
"@floating-ui/dom": "^1.6.12",
"@mapbox/mapbox-gl-directions": "^4.3.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.4",
"@repo/theme": "*",
"@shopify/draggable": "^1.1.3",
"@tanstack/react-virtual": "^3.10.9",
"classnames": "^2.5.1",
"fuse.js": "^7.0.0",
"graphql": "^16.9.0",
"iconoir-react": "^7.10.0",
"mapbox-gl": "^3.8.0",
"moment": "^2.30.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.0.1",
"recharts": "^2.13.3"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@types/mapbox-gl": "^3.4.1",
"@types/node": "^22.10.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.15.0",
"serve": "^14.2.4",
"typescript": "^5.7.2",
"vite": "^6.0.1"
}
}
7 changes: 0 additions & 7 deletions apps/frontend/src/app/About/About.module.scss

This file was deleted.

4 changes: 1 addition & 3 deletions apps/frontend/src/app/About/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import styles from "./About.module.scss";

export default function About() {
return <div className={styles.root}></div>;
return <></>;
}
4 changes: 2 additions & 2 deletions apps/frontend/src/app/Catalog/Catalog.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

@media (width > 992px) {
&:not(.expanded) .panel {
&.collapsed .panel {
display: none;
}

Expand Down Expand Up @@ -65,4 +65,4 @@
display: none;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
top: 0;
left: 0;
opacity: 0;
background: linear-gradient(to right, var(--background-color), transparent);
background: linear-gradient(
to right,
var(--background-color),
transparent
);
transition: opacity 100ms ease-in-out;
}

Expand All @@ -35,7 +39,11 @@
top: 0;
right: 0;
opacity: 0;
background: linear-gradient(to left, var(--background-color), transparent);
background: linear-gradient(
to left,
var(--background-color),
transparent
);
transition: opacity 100ms ease-in-out;
}

Expand Down Expand Up @@ -90,4 +98,4 @@
}
}
}
}
}
9 changes: 7 additions & 2 deletions apps/frontend/src/app/Catalog/Dashboard/Dashboard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
font-size: 24px;
line-height: 1.25;
font-weight: 660;
font-feature-settings: "cv05" on, "cv13" on, "ss07" on, "cv12" on, "cv06" on;
font-feature-settings:
"cv05" on,
"cv13" on,
"ss07" on,
"cv12" on,
"cv06" on;
color: var(--heading-color);
margin-top: 32px;
}
Expand All @@ -43,4 +48,4 @@
color: var(--paragraph-color);
margin-top: 8px;
}
}
}
4 changes: 2 additions & 2 deletions apps/frontend/src/app/Catalog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function Catalog() {
pathname: `/catalog/${term.year}/${term.semester}/${subject}/${courseNumber}/${number}`,
});
},
[navigate, year, semester, location, term]
[navigate, location, term]
);

// TODO: Loading state
Expand All @@ -102,7 +102,7 @@ export default function Catalog() {
return (
<div
className={classNames(styles.root, {
[styles.expanded]: expanded,
[styles.collapsed]: !expanded,
[styles.open]: open,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
pointer-events: none;
font-size: 16px;
line-height: 1;
}
}
2 changes: 1 addition & 1 deletion apps/frontend/src/app/Discover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function Discover() {
onChange={(event) => setInput(event.target.value)}
/>
<Placeholder className={styles.placeholder} />
<Button className={styles.button} variant="solid">
<Button variant="solid">
Search
<ArrowRight />
</Button>
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/app/GradeDistributions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default function GradeDistributions() {
});

return response;
} catch (error) {
} catch {
// TODO: Handle errors

return null;
Expand All @@ -192,7 +192,7 @@ export default function GradeDistributions() {
setOutputs(output);

setLoading(false);
}, [inputs]);
}, [client, inputs]);

useEffect(() => {
initialize();
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/app/Landing/Hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function Hero() {
autoFocus
placeholder="Search for courses..."
/>
<Button className={styles.button} variant="solid">
<Button variant="solid">
Go
<ArrowRight />
</Button>
Expand Down
16 changes: 8 additions & 8 deletions apps/frontend/src/app/Landing/Organization/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default function Organization() {
<Container>
<h3 className={styles.heading}>Get involved</h3>
<div className={styles.accordion}>
<details className={styles.details}>
<summary className={styles.summary}>
<details>
<summary>
<h3 className={styles.title}>Join our team</h3>
<Plus height={24} width={24} />
<Minus height={24} width={24} />
Expand All @@ -26,27 +26,27 @@ export default function Organization() {
students.
</p>
</details>
<details className={styles.details}>
<summary className={styles.summary}>
<details>
<summary>
<h3 className={styles.title}>Contribute</h3>
<Plus height={24} width={24} />
<Minus height={24} width={24} />
</summary>
<p className={styles.description}>
<p className={styles.content}>
Become part of a dynamic and innovative group dedicated to helping
students navigate Berkeley! Roles on the Berkeleytime team include
backend & frontend development, product design, user research, and
marketing. We are always looking for passionate and talented
students.
</p>
</details>
<details className={styles.details}>
<summary className={styles.summary}>
<details>
<summary>
<h3 className={styles.title}>Provide feedback</h3>
<Plus height={24} width={24} />
<Minus height={24} width={24} />
</summary>
<p className={styles.description}>
<p className={styles.content}>
Berkeleytime is an open-source project. If you are interested in
contributing to the project, check out our
</p>
Expand Down
Loading

0 comments on commit 57b1950

Please sign in to comment.