add prettier and eslint rules

This commit is contained in:
Rory Healy 2022-09-13 16:32:45 +10:00
parent 666fc7d13a
commit 4afb09cdcf
Signed by: roryhealy
GPG Key ID: 610ED1098B8F435B
12 changed files with 1045 additions and 901 deletions

3
.eslintignore Normal file
View File

@ -0,0 +1,3 @@
.next
dist
node_modules/

View File

@ -1,3 +1,19 @@
{
"extends": "next/core-web-vitals"
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "prettier"],
"rules": {}
}

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
.next
dist
node_modules/
.vscode/
.github/
next.config.js

13
.prettierrc Normal file
View File

@ -0,0 +1,13 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf"
}

1839
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,14 +11,18 @@
},
"dependencies": {
"bootstrap": "^5.2.1",
"next": "12.2.5",
"next": "12.3.0",
"react": "18.2.0",
"react-bootstrap": "^2.5.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"eslint": "8.23.0",
"eslint-config-next": "12.2.5",
"jest": "^29.0.1"
"eslint": "8.23.1",
"eslint-config-next": "12.3.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.8",
"jest": "^29.0.3",
"prettier": "^2.7.1"
}
}

View File

@ -1,7 +1,7 @@
import '../styles/globals.css'
import '../styles/globals.css';
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}
export default MyApp
export default MyApp;

View File

@ -1,5 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default function handler(req, res) {
res.status(200).json({ name: 'John Doe' })
res.status(200).json({ name: 'John Doe' });
}

View File

@ -1,13 +1,11 @@
import Link from 'next/link'
import styles from '../../styles/Exercises.module.css'
import Link from 'next/link';
import styles from '../../styles/Exercises.module.css';
export default function ExercisesPage() {
return (
<div className={styles.container}>
<main className={styles.main}>
<h1>
This is the exercises page!
</h1>
<h1>This is the exercises page!</h1>
<div className={styles.grid}>
<div className={styles.card}>
@ -18,5 +16,5 @@ export default function ExercisesPage() {
</div>
</main>
</div>
)
);
}

View File

@ -1,20 +1,21 @@
import Head from 'next/head'
import Link from 'next/link'
import styles from '../styles/Home.module.css'
import Head from 'next/head';
import Link from 'next/link';
import styles from '../styles/Home.module.css';
export default function Home() {
return (
<div className={styles.container}>
<Head>
<title>Workout Buddy</title>
<meta name="description" content="Workout Buddy - Helping you find and create workouts" />
<meta
name="description"
content="Workout Buddy - Helping you find and create workouts"
/>
<link rel="icon" href="/favicon.ico" />
</Head>
<main className={styles.main}>
<h1 className={styles.title}>
Workout Buddy
</h1>
<h1 className={styles.title}>Workout Buddy</h1>
<p className={styles.description}>
Helping you find and create workouts
@ -43,5 +44,5 @@ export default function Home() {
</div>
</main>
</div>
)
);
}

View File

@ -1,13 +1,11 @@
import Link from 'next/link'
import styles from '../../styles/Profile.module.css'
import Link from 'next/link';
import styles from '../../styles/Profile.module.css';
export default function ProfilePage() {
return (
<div className={styles.container}>
<main className={styles.main}>
<h1>
Alice Brown
</h1>
<h1>Alice Brown</h1>
<div className={styles.grid}>
<div className={styles.card}>
@ -42,5 +40,5 @@ export default function ProfilePage() {
</div>
</main>
</div>
)
);
}

View File

@ -1,13 +1,11 @@
import Link from 'next/link'
import styles from '../../styles/Workouts.module.css'
import Link from 'next/link';
import styles from '../../styles/Workouts.module.css';
export default function WorkoutsPage() {
return (
<div className={styles.container}>
<main className={styles.main}>
<h1>
This is the workouts page!
</h1>
<h1>This is the workouts page!</h1>
<div className={styles.grid}>
<div className={styles.card}>
@ -18,5 +16,5 @@ export default function WorkoutsPage() {
</div>
</main>
</div>
)
);
}