Skip to content

Enforce eslint and prettier rules with a pre-commit hook #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"rules": {
"@next/next/no-img-element": "off",
"import/no-anonymous-default-export": [
"warn",
{
"allowObject": true
}
]
Comment on lines +5 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure what this fixes.

}
}
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

# nova
.nova
# nova
.nova

# eslint
.eslintcache
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
27 changes: 14 additions & 13 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import React from "react"

const communityDescription = `
We're a community of developers of all skill levels, dedicated to fostering a fun and
educational environment. Hosted by Sam Holmes and a team of passionate organizers, our
monthly meetups offer an opportunity to network, learn, and showcase your projects. At
each event, you'll enjoy complimentary food and drinks during our networking lunch,
followed by a series of engaging presentations on various developer and engineering
topics. After the talks, we break into groups for casual networking, project showcases,
and coding help. Whether you're a seasoned developer or just starting out, there's
something for everyone. Be sure to bring your laptop if you'd like to share your latest
project or give a presentation. We look forward to meeting you and seeing what you're
excited about!
`
Comment on lines +3 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I resolved this same issue in my PR, but instead of factoring out the string, I kept it inline. That'd be preferable since this consts is single-use.


export default function About() {
return (
<main className="p-8 bg-gray-900 min-h-screen text-white">
Expand All @@ -13,19 +26,7 @@ export default function About() {
<section className="bg-gray-800 p-8 rounded-lg shadow-md mb-12">
<h2 className="text-3xl font-bold mb-4 text-center">About us</h2>
<div className="w-full flex justify-center">
<p className="mt-2 text-xl text-center max-w-screen-lg">
{" "}
We're a community of developers of all skill levels, dedicated to fostering a fun and
educational environment. Hosted by Sam Holmes and a team of passionate organizers, our
monthly meetups offer an opportunity to network, learn, and showcase your projects. At
each event, you'll enjoy complimentary food and drinks during our networking lunch,
followed by a series of engaging presentations on various developer and engineering
topics. After the talks, we break into groups for casual networking, project showcases,
and coding help. Whether you're a seasoned developer or just starting out, there's
something for everyone. Be sure to bring your laptop if you'd like to share your latest
project or give a presentation. We look forward to meeting you and seeing what you're
excited about!
</p>
<p className="mt-2 text-xl text-center max-w-screen-lg">{communityDescription}</p>
</div>
</section>

Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Footer = () => {
return (
<footer className="footer bg-neutral text-neutral-content items-center p-4">
<aside className="grid-flow-col items-center">
<img src="/images/logo.jpeg" className="w-8 rounded" />
<img src="/images/logo.jpeg" alt="SD DEVx logo" className="w-8 rounded" />
<p>© Copyright {new Date().getFullYear()}. All rights reserved</p>
</aside>
<nav className="grid-flow-col gap-4 md:place-self-center md:justify-self-end">
Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Header = () => {
</ul>
</div>
<a className="btn btn-ghost inline p-0" href="/">
<img src="/images/logo.jpeg" className="w-12 rounded" />
<img src="/images/logo.jpeg" alt="SD DEVx logo" className="w-12 rounded" />
</a>
</div>
<div className="navbar-center hidden lg:flex">
Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function Home() {
return (
<main>
<img className="hero h-96 object-cover" src="/images/devx-hero.jpg" />
<img className="hero h-96 object-cover" src="/images/devx-hero.jpg" alt="" />
<div className="hero py-12">
<div className="hero-content text-neutral-content text-center">
<div className="max-w-md">
Expand Down
Loading