Skip to content

Commit

Permalink
Add workflow for running checks on pushes and PRs (#184)
Browse files Browse the repository at this point in the history
* Switch to eslint v8 for compatibility with Next

- Downgrade eslint version to be compatible with eslint-config-next
- Move eslint from root to individual packages
- Move some site dependencies to devDependencies

* Add workflow for running checks on pushes and PRs

- Add Actions workflow for running checks, adapted from irvinehacks-site
- Upgrade pnpm version specified in `packageManager` to match lockfile

* Resolve ESLint issues in `FAQ.tsx`
  • Loading branch information
taesungh authored Oct 22, 2024
1 parent 7e895de commit 8ffc2e8
Show file tree
Hide file tree
Showing 6 changed files with 270 additions and 230 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run Checks

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check-site:
name: Check Site
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4
# pnpm version will be determined by `packageManager` in `package.json`

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install frontend dependencies
run: pnpm install

- name: Format with Prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:
# cannot use workdir since action would look in package root, not workspace for `.bin/prettier`
level: warning
reporter: github-pr-review
prettier_flags: apps/site/src

- name: Lint with ESLint (review)
uses: reviewdog/action-eslint@v1
if: github.event_name == 'pull_request'
with:
workdir: apps/site
level: error
reporter: github-pr-review
eslint_flags: src

- name: Lint with ESLint (check)
uses: reviewdog/action-eslint@v1
if: github.event_name == 'push'
with:
workdir: apps/site
level: error
reporter: github-check
eslint_flags: src
2 changes: 1 addition & 1 deletion apps/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@sanity/eslint-config-studio": "^4.0.0",
"@types/react": "^18.3.8",
"@types/styled-components": "^5.1.34",
"eslint": "^9.10.0",
"eslint": "^8.57.1",
"eslint-plugin-sanity-studio": "^1.0.0",
"prettier": "^3.3.3",
"typescript": "^5.6.2"
Expand Down
16 changes: 9 additions & 7 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@
"dependencies": {
"@portabletext/react": "^3.1.0",
"@sanity/image-url": "^1.0.2",
"@types/node": "22.5.5",
"@types/react": "18.3.8",
"@types/react-dom": "^18.3.0",
"bootstrap": "^5.3.3",
"clsx": "^2.1.1",
"date-fns-tz": "^3.1.3",
"eslint": "9.10.0",
"eslint-config-next": "^14.2.13",
"framer-motion": "^11.5.5",
"next": "^14.2.13",
"next-sanity": "^9.5.0",
Expand All @@ -30,7 +25,14 @@
"react-dom": "^18.3.1",
"react-use": "^17.5.1",
"sass": "^1.79.2",
"typescript": "5.6.2",
"zod": "^3.23.8"
},
"devDependencies": {
"typescript": "5.6.2",
"@types/node": "22.5.5",
"@types/react": "^18.3.8",
"@types/react-dom": "^18.3.0",
"eslint": "^8",
"eslint-config-next": "^14.2.15"
}
}
}
10 changes: 4 additions & 6 deletions apps/site/src/app/(home)/sections/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ const FAQ = async () => {
>
<span className={styles["faq-header"] + " h4"}>
<h2 className="visually-hidden">FAQ</h2>
<span className={styles["light-blue-text"]}>FAQ!</span> Here's
<span className={styles["light-blue-text"]}>FAQ!</span> Here&apos;s
answers to our most commonly asked questions!
</span>

<p>
If you don't find what you're looking for, reach out to our team at{" "}
<a
className={styles["purple-text"]}
href="mailto:[email protected]"
>
If you don&apos;t find what you&apos;re looking for, reach out to
our team at{" "}
<a className={styles["purple-text"]} href="mailto:[email protected]">
[email protected]
</a>
</p>
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
},
"devDependencies": {
"@turbo/gen": "^2.1.2",
"eslint": "^9.10.0",
"prettier": "3.3.3",
"turbo": "^2.1.2"
},
"packageManager": "pnpm@8.6.10",
"packageManager": "pnpm@9.12.2",
"name": "zothacks-site"
}
Loading

0 comments on commit 8ffc2e8

Please sign in to comment.