diff --git a/code/react-folder/react-assignment/react-recipe/.gitignore b/code/react-folder/react-assignment/react-recipe/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/code/react-folder/react-assignment/react-recipe/.gitignore @@ -0,0 +1,24 @@ +# 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/code/react-folder/react-assignment/react-recipe/README.md b/code/react-folder/react-assignment/react-recipe/README.md new file mode 100644 index 00000000..f768e33f --- /dev/null +++ b/code/react-folder/react-assignment/react-recipe/README.md @@ -0,0 +1,8 @@ +# React + 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/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh diff --git a/code/react-folder/react-assignment/react-recipe/eslint.config.js b/code/react-folder/react-assignment/react-recipe/eslint.config.js new file mode 100644 index 00000000..238d2e4e --- /dev/null +++ b/code/react-folder/react-assignment/react-recipe/eslint.config.js @@ -0,0 +1,38 @@ +import js from '@eslint/js' +import globals from 'globals' +import react from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' + +export default [ + { ignores: ['dist'] }, + { + files: ['**/*.{js,jsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: { jsx: true }, + sourceType: 'module', + }, + }, + settings: { react: { version: '18.3' } }, + plugins: { + react, + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...js.configs.recommended.rules, + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + ...reactHooks.configs.recommended.rules, + 'react/jsx-no-target-blank': 'off', + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, + }, +] diff --git a/code/react-folder/react-assignment/react-recipe/index.html b/code/react-folder/react-assignment/react-recipe/index.html new file mode 100644 index 00000000..4939bf90 --- /dev/null +++ b/code/react-folder/react-assignment/react-recipe/index.html @@ -0,0 +1,13 @@ + + +
+ + + +Error loading recipe. Please try again later.
; + } + + return ( +Error: {error.message}
+ return ( + // View { + //No Recipes Found
+ : recipes.map(rec => +{recipe.instructions}
+