Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wave 03 #15

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# make an .env file and copy this file to a .env
# so that the base url can be read by the app
VITE_BASE_URL=http://localhost:5000
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ dist
dist-ssr
*.local

.env

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ The goals of this pair project are to:
- Use `axios` to make API calls to update state
- Write controlled form components

## Forking the Repository
When forking this repository, be sure to uncheck the button that says: "Copy the `main` branch only"


## Project Directions

- Part 1: React Components, Props, State and Event Handling
- [Wave 01: Setup and Baseline](./project-docs/wave-01.md)
- [Wave 02: Lifting Up State](./project-docs/wave-02.md)
- [Wave 02: State and Event Handling](./project-docs/wave-02.md)
- [Wave 03: Lifting Up State](./project-docs/wave-03.md)
- Part 2: Connecting to the Task List API
- [Wave 03: useEffect And Axios](./project-docs/wave-03.md)
- [Wave 04: Handling Forms](./project-docs/wave-04.md)
- [Wave 04: useEffect And Axios](./project-docs/wave-04.md)
- [Wave 05: Handling Forms](./project-docs/wave-05.md)

## Notes on Tests

Expand Down
76 changes: 76 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { fixupConfigRules } from "@eslint/compat";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import vitestGlobals from "eslint-plugin-vitest-globals";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/dist", "**/.eslintrc.cjs", "**/eslint.config.mjs", "**/vite.config.js"],
},
{
files: ["**/*.js", "**/*.jsx"]
}
, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:vitest-globals/recommended",
)), {
plugins: {
"react-refresh": reactRefresh,
},

languageOptions: {
globals: {
...globals.browser,
...vitestGlobals.environments.env.globals,
},

ecmaVersion: "latest",
sourceType: "module",
},

settings: {
react: {
version: "18.2",
},
},

rules: {
"react-refresh/only-export-components": ["warn", {
allowConstantExport: true,
}],


"max-len": [1, 120, 2, { "ignoreComments": true }],
"no-console": "off",
quotes: ["error", "single", {
allowTemplateLiterals: true,
avoidEscape: true,
}],
"camelcase": ["error", {"properties": "always"}],
"semi": ["warn", "always"],
"comma-dangle": ["warn", "only-multiline"],
"dot-notation": "warn",
"space-before-function-paren": "off",
"indent": ["warn", 2],
"padded-blocks": "warn",
"no-trailing-spaces": "warn",
"array-bracket-spacing": "warn",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"padded-blocks": ["error", "never"],
"no-var": "error",
},
}];
Loading