Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
a41b61c
feat: install vite (react, eslint)
alexpodelinskii Apr 29, 2025
201a4a8
feat: add prettier in project
alexpodelinskii Apr 29, 2025
0f6fa11
feat: add husky in project
alexpodelinskii Apr 29, 2025
7831861
refact: change husky settings
alexpodelinskii Apr 29, 2025
052b927
feat: add file to set api client
SashAwl May 3, 2025
fcabbc8
fix: correct file to set api client
SashAwl May 3, 2025
5ea736a
feat: add jest in project and create tests
alexpodelinskii May 3, 2025
6c9553a
feat: add project structure
SashAwl May 5, 2025
4da36b5
feat: add project structure
SashAwl May 5, 2025
4bde7dc
add .env example
SashAwl May 5, 2025
dde3f42
Merge pull request #1 from SashAwl/createDevEnv
SashAwl May 5, 2025
9247d76
Merge branch 'main' into develop
SashAwl May 5, 2025
13242a8
Merge pull request #3 from SashAwl/project-structure
alexpodelinskii May 5, 2025
6a1b757
feat(RSS-ECOMM-1_17): Update README with project description
crlinm May 5, 2025
2673044
feat(RSS-ECOMM-1_20): Add setup instructions to README
crlinm May 5, 2025
d0b33ce
feat(RSS-ECOMM-1_19): Document scripts in README
crlinm May 5, 2025
d4b24a0
Merge pull request #5 from SashAwl/rss_ecomm_1p6_Comprehensive_README
SashAwl May 5, 2025
0dd687c
fix: remove double files
SashAwl May 10, 2025
cfc07bc
feat: add sdk
alexpodelinskii May 12, 2025
1101276
fix: delete double files
SashAwl May 14, 2025
d64d6d8
feat: add registration loyout and registration customers with SDK
alexpodelinskii May 15, 2025
38f8aa9
feat: add husky in dependencies
SashAwl May 15, 2025
7150552
feat: merge commit ec2-fix-deploy to sprint2
SashAwl May 15, 2025
676fa29
'feat: add select country and input postal code'
alexpodelinskii May 15, 2025
686a659
feat: add link to first part of the project in README.md
SashAwl May 16, 2025
78ef97b
feat: add header in project
SashAwl May 17, 2025
a075b79
fix: correct styles
SashAwl May 17, 2025
8efd883
feat: add routing and not-found page
SashAwl May 17, 2025
58d05f8
fix: correct link name
SashAwl May 17, 2025
4011c6f
Merge branch 'sprint2' into ec2-home-page
SashAwl May 17, 2025
05d5c05
feat: add footer component and banner
SashAwl May 17, 2025
305bdad
feat: merge pull request #8 from SashAwl/ec2-home-page
SashAwl May 17, 2025
f2642a1
Merge branch 'sprint2' into ec2-registrationPage
alexpodelinskii May 17, 2025
b66b7dd
feat: add zustand
alexpodelinskii May 17, 2025
51726cd
feat: add billing addres and settings defoult addreses
alexpodelinskii May 18, 2025
dab82c5
feat: add rediret to main page
alexpodelinskii May 18, 2025
5fe8156
refactor: delete test file
alexpodelinskii May 18, 2025
2808890
Merge pull request #10 from SashAwl/ec2-registrationPage
alexpodelinskii May 18, 2025
68adef6
feat: create login page react component
crlinm May 18, 2025
74a5e34
fix: fix small details
crlinm May 18, 2025
c2640d5
feat: add sig nup / logout buttons
alexpodelinskii May 18, 2025
a9f929c
feat: add popup messages
alexpodelinskii May 18, 2025
bb0a5b9
feat: add popup messages and new errors messages
alexpodelinskii May 18, 2025
24d4a57
feat: add styles for login page
crlinm May 19, 2025
f6000d0
feat: merge pull request #11 from SashAwl/ec2-registrationPage
SashAwl May 19, 2025
2e5db6b
Merge remote-tracking branch 'origin/sprint2' into ec2-login-page
crlinm May 19, 2025
ec1c182
feat: add toggle menu and page link
SashAwl May 19, 2025
cc3be91
refactor: correct style name
SashAwl May 19, 2025
21927c8
feat: add redirect if customer login
alexpodelinskii May 19, 2025
122efa9
refactor: change store name
alexpodelinskii May 19, 2025
840dc8a
refactor: change redirect path
alexpodelinskii May 19, 2025
61f1a7d
feat: link to signup from login and small fixes
crlinm May 19, 2025
c60503f
feat: merge pull request #13 from SashAwl/ec2-header-functionality
SashAwl May 19, 2025
ba924a5
Merge branch 'sprint2' into ec2-registrationPage
SashAwl May 19, 2025
26caaca
feat: merge pull request #14 from SashAwl/ec2-registrationPage
SashAwl May 19, 2025
7812515
feat: navigate to main after login
crlinm May 19, 2025
b17d858
feat: add successful log in message
crlinm May 19, 2025
2066e40
feat: handle error login messages
crlinm May 19, 2025
5469464
Merge remote-tracking branch 'origin/sprint2' into ec2-login-page
crlinm May 19, 2025
fa0a903
fix: correct menu closing work; correct redirect on pages; correct st…
SashAwl May 19, 2025
bc23579
fix: merge pull request #17 from SashAwl/ec2-fix-bugs
SashAwl May 19, 2025
351c857
fix: correct redirect pages
SashAwl May 19, 2025
39e7373
fix: merge pull request #19 from SashAwl/ec2-fix-bugs2
SashAwl May 19, 2025
c35673c
Merge branch 'sprint2' into ec2-login-page
SashAwl May 19, 2025
b5cd89f
feat: finish part with fields validation
crlinm May 19, 2025
9e20848
Merge remote-tracking branch 'origin/ec2-login-page' into ec2-login-page
crlinm May 19, 2025
89ead2e
fix: fix email validation (remove type email)
crlinm May 19, 2025
f4b56cb
Merge pull request #15 from SashAwl/ec2-login-page
crlinm May 19, 2025
cb342ea
feat: get access token
crlinm May 20, 2025
dcecd0f
fix: remove saving tokens
crlinm May 22, 2025
072e5f7
feat(RSS-ECOMM-2_01): separate error messages for email validation rules
crlinm May 22, 2025
11016df
fix: show validation errors on change
crlinm May 22, 2025
89beefd
Merge pull request #20 from SashAwl/ec2-login-token
crlinm May 22, 2025
44f7a3f
refactor: split the registration page into components
alexpodelinskii May 25, 2025
b637184
refactor: change file name and add scroll to up main page
alexpodelinskii May 26, 2025
c9ee19a
Merge pull request #21 from SashAwl/ec2-registrationPage
alexpodelinskii May 26, 2025
fdd9183
feat: merge pull request #16 from SashAwl/sprint2
SashAwl May 29, 2025
319b816
feat: add category block
SashAwl May 31, 2025
893d5a9
feat: create game page
alexpodelinskii May 31, 2025
4217b7c
feat: add cards to catalog
SashAwl Jun 1, 2025
38c5796
fix: correct styles
SashAwl Jun 1, 2025
6c7b9d1
feat: merge pull request #24 from SashAwl/ec3-catalog
SashAwl Jun 1, 2025
2842d2e
feat: add title, price, description, images slider
alexpodelinskii Jun 2, 2025
90218e7
refactor: delete console.log
alexpodelinskii Jun 2, 2025
7de25c0
Merge branch 'sprint3' into ec3-game-page
alexpodelinskii Jun 2, 2025
b5d03bc
Merge pull request #25 from SashAwl/ec3-game-page
alexpodelinskii Jun 2, 2025
241758d
feat: add discount
alexpodelinskii Jun 2, 2025
6066198
feat: add filter
SashAwl Jun 2, 2025
4feb592
feat: resolve conflict
SashAwl Jun 2, 2025
94d8fae
refactor: correct router link
SashAwl Jun 2, 2025
e11e6c8
refactor: correct styles
SashAwl Jun 2, 2025
c9fb52e
feat: merge pull request #28 from SashAwl/ec3-catalog-filter
SashAwl Jun 2, 2025
02febc9
feat: add subategories
alexpodelinskii Jun 2, 2025
bcc40da
feat: update README.md
SashAwl Jun 2, 2025
5057056
feat: run deploy
SashAwl Jun 2, 2025
31a841b
feat: start working on user-profile page
crlinm Jun 2, 2025
53d7508
Merge remote-tracking branch 'origin/sprint3' into ec3-user-profile
crlinm Jun 2, 2025
16f3642
Merge branch 'sprint3' into ec3-game-page
alexpodelinskii Jun 2, 2025
7bb9dc1
Merge pull request #30 from SashAwl/ec3-game-page
alexpodelinskii Jun 3, 2025
2299ba0
feat: add password, addresses to profile
crlinm Jun 3, 2025
00aa57e
fix: correct category list
SashAwl Jun 3, 2025
f214e12
refactor: remove console.log
SashAwl Jun 3, 2025
86cf220
feat: add category filter
SashAwl Jun 3, 2025
b7186f2
feat: merge pull request #31 from SashAwl/ec3-catalog-filter-part2
SashAwl Jun 3, 2025
18ba3ac
feat: add filters and clear filter button
SashAwl Jun 3, 2025
ca31a81
fix: correct initial value for maxPrice
SashAwl Jun 3, 2025
8aed6de
feat: merge pull request #32 from SashAwl/ec3-catalog-filter-part3
SashAwl Jun 3, 2025
609c991
feat: handle default shipping and billing
crlinm Jun 3, 2025
091df61
fix: correct styles and initial filter values
SashAwl Jun 3, 2025
2fab256
Merge remote-tracking branch 'origin/sprint3' into ec3-user-profile
crlinm Jun 3, 2025
72bf08a
Merge pull request #29 from SashAwl/ec3-user-profile
crlinm Jun 3, 2025
0d3efb5
feat: edit mode name, surname, email, dateofbirth
crlinm Jun 3, 2025
1c45e97
Merge pull request #33 from SashAwl/ec3-user-profile-edit-mode
crlinm Jun 3, 2025
0197208
feat: edit password
crlinm Jun 3, 2025
ff7b03d
Merge pull request #34 from SashAwl/ec3-user-profile-edit-mode2
crlinm Jun 4, 2025
a4a9666
feat: add sort and navigation
SashAwl Jun 4, 2025
272e5f8
Merge pull request #35 from SashAwl/ec3-catalog-search
crlinm Jun 4, 2025
6a32392
feat: add success, error messages for profile updates
crlinm Jun 4, 2025
bb0d269
fix: correct navigation bug
SashAwl Jun 4, 2025
e6f6ece
feat: merge pull request #37 from SashAwl/ec3-catalog-search-part2
SashAwl Jun 4, 2025
1cd9de6
feat: add search and sort
alexpodelinskii Jun 4, 2025
83d4f45
Merge pull request #38 from SashAwl/ec3-catalog-search-part2
alexpodelinskii Jun 4, 2025
1d065ec
feat: add game description and correct navigation
SashAwl Jun 4, 2025
986fe7f
feat: merge pull request #39 from SashAwl/ec3-catalog-search-part4
SashAwl Jun 5, 2025
a4b4e28
fix: not to show profile page for unlogged user
crlinm Jun 5, 2025
8b3fd69
Merge pull request #36 from SashAwl/ec3-user-profile-edit-mode3
crlinm Jun 5, 2025
d4544f5
feat: add, remove, edit address, fix not to show profile page for unl…
crlinm Jun 5, 2025
aebdb69
Merge pull request #40 from SashAwl/ec3-user-profile-edit-mode4
crlinm Jun 5, 2025
06da583
feat: add title for about page
crlinm Jun 8, 2025
cd62798
feat: create cart page, add item to cart from game page
alexpodelinskii Jun 10, 2025
fcaa7a1
feat: add change product quantity and remove product
alexpodelinskii Jun 11, 2025
1c2892c
feat: merge pull request #26 from SashAwl/sprint3
SashAwl Jun 12, 2025
a6da79b
feat: add delete and add message, add button to game page
alexpodelinskii Jun 12, 2025
13b5047
feat: add promo codes
SashAwl Jun 14, 2025
f76deac
feat: add layout for about rs-school part
crlinm Jun 14, 2025
f745d43
feat: start layout for about-the-team section
crlinm Jun 14, 2025
59a95d3
feat: add some styles for about-team block
crlinm Jun 14, 2025
314638c
feat: add some styles for about-team github etc parts
crlinm Jun 14, 2025
70f4ff4
feat: add styles for about-team part - contribution tags
crlinm Jun 14, 2025
b6d3253
feat: add styles for about-team part - photos, all team array
crlinm Jun 15, 2025
67251f3
feat: implement lazy loading
SashAwl Jun 15, 2025
01df3fa
feat: add clear interface for waiting for a server response
SashAwl Jun 15, 2025
b0883b0
fix: correct file name
SashAwl Jun 15, 2025
93ac75a
feat: add promoCode section
alexpodelinskii Jun 15, 2025
bff6797
Merge pull request #41 from SashAwl/ec4-basket-page
alexpodelinskii Jun 15, 2025
77c352c
Merge branch 'sprint4' into ec4-catalog-lazy-loading
SashAwl Jun 15, 2025
1366de8
feat: merge pull request #44 from SashAwl/ec4-catalog-lazy-loading
SashAwl Jun 15, 2025
2dd44a2
feat: add team members description and some styles
crlinm Jun 15, 2025
038813f
feat:add promoCode discount functional
alexpodelinskii Jun 16, 2025
e3dd4d2
feat: add button and function for delete promoCode
alexpodelinskii Jun 16, 2025
16e3f50
Merge pull request #45 from SashAwl/ec4-basket-page
alexpodelinskii Jun 16, 2025
b758af3
feat: add function to add products to cart from the catalog
SashAwl Jun 16, 2025
7022a0b
fix: fixed image display
SashAwl Jun 16, 2025
d6e5e41
Merge pull request #42 from SashAwl/ec4-aboutpage
crlinm Jun 16, 2025
c86ea96
feat: merge pull request #46 from SashAwl/ec4-catalog-card-cart
SashAwl Jun 16, 2025
8a89cac
refactor: change style to main theme
alexpodelinskii Jun 16, 2025
9809ab9
feat: merge pull request #48 from SashAwl/ec4_refact_basket
SashAwl Jun 17, 2025
b832fa7
feat: create catalog slider at home
SashAwl Jun 17, 2025
16ac6f6
fix: correct add to cart function
SashAwl Jun 17, 2025
8932319
Merge branch 'sprint4' into ec4-catalog-at-home
SashAwl Jun 17, 2025
18c4975
feat: add cart counter
SashAwl Jun 17, 2025
c5a64ff
fix: fix conflict
SashAwl Jun 17, 2025
c598a8a
feat: merge pull request #50 from SashAwl/ec4-catalog-at-home
SashAwl Jun 17, 2025
5817859
refactor: delete console logs and add popup message
alexpodelinskii Jun 17, 2025
fc5f56f
feat; add popup message component
alexpodelinskii Jun 17, 2025
f0f638a
feat: merge pull request #51 from SashAwl/ec4_refact_basket
SashAwl Jun 18, 2025
79fa57b
feat: add function to add game to wishlist
SashAwl Jun 18, 2025
aea1f39
fix: error clear cart
SashAwl Jun 18, 2025
a3442a1
Merge pull request #52 from SashAwl/ec4-liked-game
alexpodelinskii Jun 18, 2025
318c357
fix: fixed issue of double-clicking on slow networks
SashAwl Jun 19, 2025
0680ba0
feat: add loading indicator is shown while the API call is in progress
SashAwl Jun 19, 2025
c592b76
Merge pull request #53 from SashAwl/ec4-fix-loading-error
alexpodelinskii Jun 19, 2025
67cec83
feat: merge pull request #47 from SashAwl/sprint4
SashAwl Jun 20, 2025
260232b
feat: add contibuting rules to readme file
crlinm Jun 20, 2025
e093b80
Merge pull request #54 from SashAwl/readme-contributing
alexpodelinskii Jun 21, 2025
b6546db
feat: change functions that show error message and succsess message
alexpodelinskii Jun 22, 2025
0643cb8
refactor: add disable for buttons add and remove promoCode
alexpodelinskii Jun 22, 2025
aec034b
refactor: add catrItem component
alexpodelinskii Jun 22, 2025
913862f
refact: move localStorage-related functions to separate utils module
SashAwl Jun 23, 2025
c6f5a6c
feat: merge pull request #55 from SashAwl/refact-basketPage
SashAwl Jun 23, 2025
7f414bd
Merge branch 'develop' of https://github.com/SashAwl/eCommerce-Applic…
SashAwl Jun 23, 2025
596febb
refactor: created separate components empty_basker, promo_section and…
alexpodelinskii Jun 23, 2025
ca2f07a
Merge pull request #56 from SashAwl/refact-basketPage
alexpodelinskii Jun 23, 2025
772eeb2
feat: add new commercetools project
SashAwl Jul 3, 2025
a49c064
fix: restore removed types
SashAwl Jul 7, 2025
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
23 changes: 23 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CT_PROJECT_KEY=
CT_CLIENT_ID=
CT_CLIENT_SECRET=
CT_AUTH_URL=https://auth.australia-southeast1.gcp.commercetools.com
CT_API_URL=https://api.australia-southeast1.gcp.commercetools.com

## MM2

CTP_PROJECT_KEY=mergemates
CTP_CLIENT_SECRET=FkhY5qVk6Qk2sar3CD_CmCJE-F-V5lcK
CTP_CLIENT_ID=4RGYbxNx06XWyKo5mFLosMQ5
CTP_AUTH_URL=https://auth.australia-southeast1.gcp.commercetools.com
CTP_API_URL=https://api.australia-southeast1.gcp.commercetools.com
CTP_SCOPES=view_published_products:mergemates view_categories:mergemates manage_my_payments:mergemates create_anonymous_token:mergemates manage_my_quote_requests:mergemates manage_my_orders:mergemates manage_my_shopping_lists:mergemates manage_my_business_units:mergemates manage_my_profile:mergemates manage_my_quotes:mergemates

## MM_ADMIN

CTP_PROJECT_KEY=mergemates
CTP_CLIENT_SECRET=WYfOviHMQFxXFNtWurOwi_wBkZKTUHvp
CTP_CLIENT_ID=dZnENdU2BB32IKq7Bc_0AlsW
CTP_AUTH_URL=https://auth.australia-southeast1.gcp.commercetools.com
CTP_API_URL=https://api.australia-southeast1.gcp.commercetools.com
CTP_SCOPES=manage_project:mergemates
80 changes: 37 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# compiled output
/dist
/tmp
/out-tsc

# Dependency directories
node_modules/
jspm_packages/

# Runtime data
pids
*.pid
Expand All @@ -12,78 +25,59 @@ pids
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
# Coverage directory
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt
.grunt

# Bower dependency directory (https://bower.io/)
# Bower
bower_components

# node-waf configuration
# node-waf
.lock-wscript

# IDEs and editors
# Editor directories and files
.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
.vscode/
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
# Misc
.sass-cache
connect.lock
typings
.DS_Store
Thumbs.db

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*


# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
# REPL
.node_repl_history

# Output of 'npm pack'
# npm
.npm
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
# eslint
.eslintcache

# next.js build output
# next.js
.next

# Lerna
lerna-debug.log
# dotenv
.env

# System Files
.DS_Store
Thumbs.db
# Other
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eslint.config.js
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
87 changes: 86 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,86 @@
# eCommerce-Application
# eCommerce-Application

[![Link](https://img.shields.io/badge/View%20Demo-Online-brightgreen?logo=netlify)](https://commercetools-gamestore.netlify.app/)

## 🎮 Description

A modern e-commerce web app where users can browse products, add them to a cart, and simulate purchases. It's built with up-to-date frontend tools and serves as a starting point for real online stores.

## Purpose

The main goal of this project is to learn and apply best practices in frontend development using modern tools. It's built to be easy to grow and update, and it helps the team practice working together while connecting the app to **CommerceTools**, a headless e-commerce platform.

## Technology stack

- React
- Typescript
- Vite
- Eslint, Prettier, husky
- Jest
- CommerceTools

## 📜 Available Scripts

The following scripts are defined in the `package.json` and can be run using `npm run <script>`:

| Script | Description |
| --------- | ------------------------------- |
| `dev` | Starts the development server. |
| `build` | Build for production. |
| `preview` | Preview the production build. |
| `lint` | Lint the codebase. |
| `format` | Format all files with Prettier. |
| `prepare` | Prepares Git hooks using Husky. |
| `test` | Run tests with Jest. |

## 🚀 Running the Application

Follow these steps to set up and run the application:

### 1. Copy and rename the `.env-example` file

Rename the `.env-example` file to `.env` in the root of the project directory.

```bash
cp .env-example .env
```

### 2. Set environment variables with your data

### 3. Install dependencies

Rename the `.env-example` file to `.env` in the root of the project directory.

```bash
npm install
```

### 4. Run the application

To start the development server, run the following command:

```bash
npm run dev
```

## 🤝 Contributing

Contributions are welcome! To help us accept your changes quickly, please follow these simple rules:

1. Create Pull Requests: All changes must be submitted via a Pull Request from your own fork of this repository.
2. Implement your changes, keeping the coding style consistent.
4. Lint and Format: Before committing, run the linter and formatter to ensure your code adheres to the project's standards.

```bash
npm run lint
npm run format
```

5. Commit Your Changes: Commit your work with a clear and descriptive commit message.
```bash
git commit -m "feat: Add new awesome feature"
```

7. Open a Pull Request from your branch to the develop branch of the main repository. Provide a clear description of the changes you've made.

We appreciate your help in making this GameStore even better!
54 changes: 54 additions & 0 deletions ViteInstallRecomendation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
});
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x';
import reactDom from 'eslint-plugin-react-dom';

export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
});
```
4 changes: 4 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true
},
],
},ignores: [
"**/temp.js",
"config/*",
"jest.config.ts"
],
},
);
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/gamepad-solid.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Game Store</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable */

import { Config } from 'jest';

const config: Config = {
rootDir: './',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/test/jest.setup.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
moduleNameMapper: {
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/mock/fileMock.js',
'\\.(css|less)$': 'identity-obj-proxy',
},
extensionsToTreatAsEsm: ['.ts', '.tsx'],
};

export default config;
Loading