Skip to content

Commit 80cea3f

Browse files
authored
Merge branch 'code-differently:main' into lesson_05
2 parents 85ae4b4 + e422bce commit 80cea3f

17 files changed

+5977
-1
lines changed

lesson_06/README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,25 @@ 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 code in the [expression_calculator.ts][calculator-file] file.
20+
2. To check your work, you can run the application using the first command below and run the tests using the second one.
21+
```bash
22+
npm run compile
23+
npm start
24+
```
25+
3. As usual, make sure that you format your code and run the check command before creating your pull request.
26+
```bash
27+
npm run check
28+
```
29+
4. You must only submit changes to the `expression_calculator.ts` file to receive full credit.
30+
31+
[article-link]: https://blog.danslimmon.com/2024/01/18/3-questions-that-will-make-you-a-phenomenal-rubber-duck/
32+
[calculator-file]: ./expression/src/expression_calculator.ts

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/.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)