-
Notifications
You must be signed in to change notification settings - Fork 629
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
tracking: enable noUncheckedIndexedAccess
#4040
Comments
The following seem to be free of issues:
The following are used by many other modules so appear frequently as noise when running
The following have many issues and might take a bit more effort:
I'm going to have a bash at |
Thanks, @syhol! I've updated the initial comment. |
flags is passing the check now that cli has been resolved. This can be removed or checked off @iuioiua. |
working on enabling noUncheckedIndexedAccess in path |
refactor(path): prepare for noUncheckedIndexedAccess (#4040)
For those wanting to contribute, I've updated the task list, as a few sub-modules have changed since the creation of this issue. Only a little more to go. |
http was done by @gabelluardo on Feb 15th. I think you can check it off. |
There are still missing parts in |
I can't recreate it. @iuioiua is the issue on my side or yours? Could we get a third party to check? Terminal output from my local setupdeno_std on main [!] via 🦕 v1.41.1
❯ git pull origin main
From https://github.com/denoland/deno_std
* branch main -> FETCH_HEAD
Already up to date.
deno_std on main [!] via 🦕 v1.41.1
❯ git diff
diff --git a/deno.json b/deno.json
index 619ab66f..d2db1fcf 100644
--- a/deno.json
+++ b/deno.json
@@ -2,6 +2,7 @@
"compilerOptions": {
"strict": true,
"useUnknownInCatchVariables": true,
+ "noUncheckedIndexedAccess": true,
"noImplicitOverride": true
},
"imports": {
deno_std on main [!] via 🦕 v1.41.1
❯ deno check http/**/*.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/_mock_conn.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/_negotiation/common.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/_negotiation/encoding.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/_negotiation/language.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/_negotiation/media_type.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/cookie.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/cookie_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/etag.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/etag_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/file_server.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/file_server_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/mod.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/negotiation.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/negotiation_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/server.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/server_sent_event_stream.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/server_sent_event_stream_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/server_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/status.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/status_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/testdata/file_server_as_library.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/unstable_signed_cookie.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/unstable_signed_cookie_test.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/user_agent.ts
Check file:///Users/simon.holloway/Code/syhol/deno_std/http/user_agent_test.ts Command to run it inside a fresh checkout in a docker containerWarning: Its a bit slow, takes about 3-4 minutes to run for my machine docker run -i --rm denoland/deno:1.41.1 bash << EOF
apt-get update
apt-get install git jq -y
cd srv
git clone https://github.com/denoland/deno_std
cd deno_std
git pull origin main
jq '.compilerOptions += {"noUncheckedIndexedAccess": true}' deno.json > deno-new.json
mv deno-new.json deno.json
git diff
find http -type f -name "*.ts" | xargs -n1 deno check && echo "Check Succeeded" || echo "Check Failed"
EOF |
Use |
Ahh I see thanks. |
I've just updated the list once more. We're now quite close to having this completed. |
Background
The
noUncheckedIndexedAccess
TSConfig option makes access objects safer and improves object inference. Enabling this option will improve the overall code quality of the Standard Library. This tracking issue aims to shine a new light on the functionality first brought up in #937.Objectives
Modify the sub-modules of the Standard Library such that the TypeScript checker has no problems. The list of applicable sub-modules includes:
How to contribute
This assumes that the Contributing Guidelines are being followed. Also, please read this before proceeding with one of these PRs.
// deno.json { "compilerOptions": { "strict": true, "useUnknownInCatchVariables": true, "noImplicitOverride": true, + "noUncheckedIndexedAccess": true }, ... }
std/collections
:// deno.json { "compilerOptions": { "strict": true, "useUnknownInCatchVariables": true, "noImplicitOverride": true, - "noUncheckedIndexedAccess": true }, ... }
The option will be enabled globally once the appropriate adjustments have been made to the entire codebase.
References
NoUncheckedIndexedAccess
TS compiler option #937noUncheckedIndexedAccess
TS compiler option #4039The text was updated successfully, but these errors were encountered: