diff --git a/.gitignore b/.gitignore index cf6880f43..a547bf36d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,24 @@ -.idea -node_modules/ -*.tsbuildinfo +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/README.md b/README.md index 961431df4..7dbf7ebf3 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,73 @@ -# Задание для Front-end стажёра +# 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 [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) -## Что нужно сделать ? +## React Compiler -- форкнуть этот репозитарий в свой github аккаунт -- реализовать проект по описанию ниже -- опубликовать его на github pages -- прислать нам свой гитхаб аккаунт и ссылку на опубликованный сайт -- ждать обратной связи :) +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). -## Проект "Кошачий пинтерест" +## Expanding the ESLint configuration -Необходимо реализовать интерфейс для просмотра котиков используя API https://thecatapi.com +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: -Дизайн лежит тут - https://bit.ly/3utxaL2 +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... -- по умолчанию должна открываться вкладка "все котики" -- у котика должна быть возможность добавить в "любимые" и убрать из "любимых" -- данные о "любимых" котиках должны хранится на клиенте -- на вкладке "любимые котики" должны отображаться добавленные в "любимые" котики -- реализация адаптивности будет плюсом, но не обязательна -- бесконечная прокрутка будет плюсом, но не обязательна -- можно использовать любой фреймворк включая vanilla.js + // 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, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +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 defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..5e6b472f5 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,23 @@ +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' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/index.html b/index.html new file mode 100644 index 000000000..518639a0d --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + +
+ + + +