Skip to content

Commit e6469cd

Browse files
committed
feat: refactor to react (#10)
1 parent 34cf145 commit e6469cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1820
-7005
lines changed

.gitignore

+23-32
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,27 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
.yarn/install-state.gz
8-
9-
# testing
10-
/coverage
11-
12-
# next.js
13-
/.next/
14-
/out/
15-
16-
# production
17-
/build
18-
19-
# misc
20-
.DS_Store
21-
*.pem
22-
23-
# debug
1+
# Logs
2+
logs
3+
*.log
244
npm-debug.log*
255
yarn-debug.log*
266
yarn-error.log*
27-
28-
# local env files
29-
.env*.local
30-
31-
# vercel
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
3225
.vercel
33-
34-
# typescript
35-
*.tsbuildinfo
36-
next-env.d.ts
26+
tsconfig.app.tsbuildinfo
27+
tsconfig.node.tsbuildinfo

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec lint-staged

.prettierrc

+3-14
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,8 @@
44
"trailingComma": "all",
55
"semi": true,
66
"printWidth": 100,
7-
"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
8-
"tailwindConfig": "./tailwind.config.ts",
7+
"plugins": ["prettier-plugin-tailwindcss"],
8+
"tailwindConfig": "./tailwind.config.js",
99
"tailwindFunctions": ["tw", "tv", "cn", "clsx"],
10-
"tailwindAttributes": ["tw", "tv", "cn", "clsx"],
11-
"importOrder": [
12-
"^react(.*)?$",
13-
"^@react(.*)?$",
14-
"^vite(.*)?$",
15-
"^@vite(.*)?$",
16-
"<THIRD_PARTY_MODULES>",
17-
"^@/(.*)$",
18-
"^~(.*)$",
19-
"^[./]"
20-
],
21-
"importOrderSeparation": true
10+
"tailwindAttributes": ["tw", "tv", "cn", "clsx"]
2211
}

README.md

+42-28
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1+
# React + TypeScript + Vite
22

3-
## Getting Started
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
44

5-
First, run the development server:
5+
Currently, two official plugins are available:
66

7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
15-
```
16-
17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18-
19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20-
21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
229

23-
## Learn More
10+
## Expanding the ESLint configuration
2411

25-
To learn more about Next.js, take a look at the following resources:
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
2613

27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
14+
- Configure the top-level `parserOptions` property like this:
2915

30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31-
32-
## Deploy on Vercel
33-
34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
16+
```js
17+
export default tseslint.config({
18+
languageOptions: {
19+
// other options...
20+
parserOptions: {
21+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
22+
tsconfigRootDir: import.meta.dirname,
23+
},
24+
},
25+
});
26+
```
3527

36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
28+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31+
32+
```js
33+
// eslint.config.js
34+
import react from "eslint-plugin-react";
35+
36+
export default tseslint.config({
37+
// Set the react version
38+
settings: { react: { version: "18.3" } },
39+
plugins: {
40+
// Add the react plugin
41+
react,
42+
},
43+
rules: {
44+
// other rules...
45+
// Enable its recommended rules
46+
...react.configs.recommended.rules,
47+
...react.configs["jsx-runtime"].rules,
48+
},
49+
});
50+
```

eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default tseslint.config(
99
...tseslint.configs.recommended, // .strict is a super set of recommended
1010
// ...tseslint.configs.strict,
1111
...tseslint.configs.stylistic,
12-
{ ignores: [".next","dist", "node_modules"] },
12+
{ ignores: [".next", "dist", "node_modules"] },
1313
{
1414
extends: [
1515
"next/core-web-vitals",

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

next.config.mjs

-4
This file was deleted.

package.json

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
11
{
2-
"name": "checker",
3-
"version": "0.1.0",
2+
"name": "my-react",
43
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
56
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "next lint"
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
1011
},
1112
"dependencies": {
1213
"@rainbow-me/rainbowkit": "^2.2.0",
13-
"@tanstack/react-query": "^5.60.6",
14-
"gitcoin-ui": "^1.2.2",
15-
"next": "14.2.18",
16-
"pino-pretty": "^13.0.0",
17-
"react": "18.3.1",
18-
"react-dom": "18.3.1",
19-
"viem": "~2.21.48",
20-
"wagmi": "^2.12.33"
14+
"@tanstack/react-query": "^5.61.5",
15+
"gitcoin-ui": "1.3.2-beta-2",
16+
"lint-staged": "^15.2.10",
17+
"prettier-plugin-tailwindcss": "^0.6.9",
18+
"react": "^18.3.1",
19+
"react-dom": "^18.3.1",
20+
"react-router": "^7.0.1",
21+
"viem": "2.x",
22+
"wagmi": "^2.13.2"
2123
},
2224
"devDependencies": {
2325
"@eslint/js": "^9.15.0",
2426
"@types/node": "^20",
25-
"@types/react": "^18",
26-
"@types/react-dom": "^18",
27+
"@types/react": "^18.3.12",
28+
"@types/react-dom": "^18.3.1",
29+
"@vitejs/plugin-react": "^4.3.4",
30+
"autoprefixer": "^10.4.20",
2731
"eslint": "^9.15.0",
28-
"eslint-config-next": "14.2.18",
2932
"eslint-config-prettier": "^9.1.0",
33+
"eslint-plugin-react-hooks": "^5.0.0",
34+
"eslint-plugin-react-refresh": "^0.4.14",
3035
"eslint-plugin-tailwindcss": "^3.17.5",
3136
"globals": "^15.12.0",
32-
"postcss": "^8",
37+
"postcss": "^8.4.49",
3338
"prettier": "^3.4.0",
3439
"prettier-plugin-tailwind-css": "^1.5.0",
35-
"tailwindcss": "^3.4.1",
36-
"typescript": "^5",
37-
"typescript-eslint": "^8.16.0"
38-
},
39-
"msw": {
40-
"workerDirectory": [
41-
"public"
42-
]
40+
"tailwindcss": "^3.4.15",
41+
"typescript": "~5.6.2",
42+
"typescript-eslint": "^8.15.0",
43+
"vite": "^6.0.1"
4344
}
4445
}

0 commit comments

Comments
 (0)