Skip to content

Commit 1f4fe28

Browse files
authored
Merge branch 'code-differently:main' into release/David.A-lesson6quiz
2 parents ab034da + 73e5c18 commit 1f4fe28

33 files changed

+13201
-1
lines changed

lesson_06/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,35 @@ Please review the following resources before lecture:
88

99
## Homework
1010

11-
- TODO(anthonydmays): Add details
11+
- [ ] Complete the [Expression Calculator](#expression-calculator) exercise.
12+
- [ ] Read article entitled [3 Questions That Will Make You A Phenomenal Rubber Duck][article-link]
13+
- [ ] Do pre-work for [lesson 07](/lesson_07/).
14+
15+
### Expression Calculator
16+
17+
For this assignment, you will need to implement the functions and logic required to calculate a mathematical expression. After implementing the `add`, `divide`, and `multiply` functions, you will combine these functions to compute the final result.
18+
19+
1. Update the [.env.test][env-file] file to configure the correct homework version.
20+
```bash
21+
# Example config for students assigned to homework "D".
22+
HW_VERSION=D
23+
```
24+
2. Run the program to determine the expression you must implement.
25+
```bash
26+
npm run compile
27+
npm start
28+
```
29+
1. Update the code in the [expression_calculator.ts][calculator-file] file.
30+
2. To check your work, you can run the application using the first command below and run the tests using the second one.
31+
```bash
32+
npm start
33+
```
34+
1. As usual, make sure that you format your code and run the check command before creating your pull request.
35+
```bash
36+
npm run check
37+
```
38+
1. You must only submit changes to the `expression_calculator.ts` file to receive full credit.
39+
40+
[article-link]: https://blog.danslimmon.com/2024/01/18/3-questions-that-will-make-you-a-phenomenal-rubber-duck/
41+
[calculator-file]: ./expression/src/expression_calculator.ts
42+
[env-file]: ./expression/.env.test

lesson_06/expression/.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true

lesson_06/expression/.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HW_VERSION=your assigned version here

lesson_06/expression/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

lesson_06/expression/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

lesson_06/expression/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

lesson_06/expression/eslint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @ts-check
2+
3+
import eslint from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
import eslintConfigPrettier from "eslint-config-prettier";
6+
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
...tseslint.configs.strict,
10+
...tseslint.configs.stylistic,
11+
eslintConfigPrettier,
12+
{
13+
ignores: ["build"],
14+
},
15+
);

lesson_06/expression/jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} **/
2+
export default {
3+
testEnvironment: "node",
4+
transform: {
5+
"^.+.tsx?$": ["ts-jest", { useESM: true }],
6+
},
7+
moduleNameMapper: {
8+
"^(\\.\\.?\\/.+)\\.js$": "$1",
9+
},
10+
extensionsToTreatAsEsm: [".ts"],
11+
};

0 commit comments

Comments
 (0)