Skip to content

Commit 7728d84

Browse files
mxdvlmarsavar
andauthored
Improve Deno project (#111)
* docs(deno): improve README * feat(deno): stricter compiler options * fix: allow unchecked indexed access This can easily throw errors that may not be valuable in the context of a code pairing test for our candidates --------- Co-authored-by: Mario Savarese <[email protected]>
1 parent c480ad4 commit 7728d84

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

typescript-deno/README.md

+5-10
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ If using VSCode, you might want to enable the extension in the settings:
99
```jsonc
1010
// .vscode/settings.json
1111
{
12-
"deno.enable": true
12+
"deno.enable": true,
13+
// or specifically
14+
"deno.enablePaths": ["./typescript-deno"]
1315
}
1416
```
1517

1618
## Usage
1719

18-
- `./script/start` to run your code
19-
- `./script/start` to run the tests
20-
21-
### Other commands
22-
23-
- `deno run src/exerciste.ts --watch` will re-run [`mod.ts`](./src/mod.ts) on every
24-
file change, for quick development feedback.
25-
- `deno test src --watch` will re-run [`mod.test.ts`](./src/mod.test.ts) on every file
26-
change, for quick development feedback.
20+
- `./script/start` to run the source code
21+
- `./script/test` to run the tests in watch mode
2722

2823
## Structure
2924

typescript-deno/deno.jsonc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"tasks": {
3+
"start": "./script/start",
4+
"test": "./script/test"
5+
},
6+
// https://github.com/guardian/csnx/blob/1be3fd98ed527ccf0f1b8e21f10039e23fdb3fb7/libs/%40guardian/tsconfig/tsconfig.json
7+
"compilerOptions": {
8+
"noImplicitReturns": true,
9+
"noUncheckedIndexedAccess": false, // disabled to prevent errors in C-style loops: https://github.com/guardian/coding-exercise-project/pull/111#discussion_r1481440786
10+
"noUnusedLocals": true,
11+
"strict": true
12+
}
13+
}

typescript-deno/deno.lock

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript-deno/script/test

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
set -e
44

5-
deno test src
5+
deno test src --watch

0 commit comments

Comments
 (0)