Skip to content

Commit 964b8f5

Browse files
authored
Merge pull request #968 from aisaenok/task-966
#966: Конфигурация темы, msw для моков, обновлен readme по началу работы с фронтом
2 parents 464f7fc + 8470e8d commit 964b8f5

File tree

21 files changed

+772
-107
lines changed

21 files changed

+772
-107
lines changed

frontend/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
mockServiceWorker.js
27+
.vscode

frontend/README.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# Get started
2+
3+
## Install
4+
5+
1. Установить NodeJS 20.19 or above (https://nodejs.org/en/download)
6+
2. Проверьте версию Node.js `node -v`
7+
3. `npm ci`
8+
4. Сгенерировать файл сервис воркера для работы моков `npx msw init ./public --save`
9+
5. Создайть файл .env.local и прописать в нем `VITE_MSW=true`
10+
11+
## Build
12+
13+
1. `npm run build`
14+
15+
## Development
16+
17+
1. `npm run dev`
18+
2. Открыть http://localhost:5173/
19+
120
# React + TypeScript + Vite
221

322
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
@@ -13,9 +32,9 @@ If you are developing a production application, we recommend updating the config
1332

1433
```js
1534
export default tseslint.config([
16-
globalIgnores(['dist']),
35+
globalIgnores(["dist"]),
1736
{
18-
files: ['**/*.{ts,tsx}'],
37+
files: ["**/*.{ts,tsx}"],
1938
extends: [
2039
// Other configs...
2140

@@ -30,40 +49,40 @@ export default tseslint.config([
3049
],
3150
languageOptions: {
3251
parserOptions: {
33-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
52+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
3453
tsconfigRootDir: import.meta.dirname,
3554
},
3655
// other options...
3756
},
3857
},
39-
])
58+
]);
4059
```
4160

4261
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:
4362

4463
```js
4564
// eslint.config.js
46-
import reactX from 'eslint-plugin-react-x'
47-
import reactDom from 'eslint-plugin-react-dom'
65+
import reactX from "eslint-plugin-react-x";
66+
import reactDom from "eslint-plugin-react-dom";
4867

4968
export default tseslint.config([
50-
globalIgnores(['dist']),
69+
globalIgnores(["dist"]),
5170
{
52-
files: ['**/*.{ts,tsx}'],
71+
files: ["**/*.{ts,tsx}"],
5372
extends: [
5473
// Other configs...
5574
// Enable lint rules for React
56-
reactX.configs['recommended-typescript'],
75+
reactX.configs["recommended-typescript"],
5776
// Enable lint rules for React DOM
5877
reactDom.configs.recommended,
5978
],
6079
languageOptions: {
6180
parserOptions: {
62-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
81+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
6382
tsconfigRootDir: import.meta.dirname,
6483
},
6584
// other options...
6685
},
6786
},
68-
])
87+
]);
6988
```

0 commit comments

Comments
 (0)