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

chore: Implement strict mode #453

Merged
merged 29 commits into from May 30, 2019

Conversation

4 participants
@bartlomieju
Copy link
Contributor

commented May 25, 2019

Closes #213

bartlomieju added some commits May 25, 2019

Show resolved Hide resolved log/levels.ts Outdated

bartlomieju and others added some commits May 25, 2019

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented May 26, 2019

This task is more complicated than I originally thought; passing tsconfig.json via --config to Deno doesn't take care about files, include and exclude options (as it shouldn't) so we have 2 options for this PR:

  • land several smaller PRs cleaning codebase gradually, PRs have to be tested locally one by one and after all landed then enable strict mode in CI
  • clean everything in one PR (that is almost each file in repo has to be modified) with CI enforcing strict mode from beginning

What are your opinions?
CC @ry @kitsonk

@zekth

This comment has been minimized.

Copy link
Contributor

commented May 26, 2019

Maybe add problematic files in exclude for the check and fix it in further PR? Otherwise it will be a bit too much work in the same PR i think.

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented May 26, 2019

Deno doesn't take care about files, include and exclude options

@zekth as stated above, Deno's TS compiler does not respect either of options

@zekth

This comment has been minimized.

Copy link
Contributor

commented May 26, 2019

Deno doesn't take care about files, include and exclude options

@zekth as stated above, Deno's TS compiler does not respect either of options

I was meaning having strict_test.ts using strict.tsconfig.json for example. But we dont have to let it stay here for long.

bartlomieju added some commits May 26, 2019

zekth and others added some commits May 26, 2019

fmt

@bartlomieju bartlomieju force-pushed the bartlomieju:chore-strict_tsconfig branch from 3b559f9 to 0429cb1 May 26, 2019

@bartlomieju bartlomieju force-pushed the bartlomieju:chore-strict_tsconfig branch from 2392e72 to 79cd16a May 26, 2019

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented May 26, 2019

Got it to green, I think we can use tsconfig.json that is already in repo (though it will produce some warnings about ignored options).

Let me know what you think, @ry, @kitsonk

@kitsonk

This comment has been minimized.

Copy link
Contributor

commented May 26, 2019

You could consider putting a minimal tsconfig in tests and extend it in the root to avoid the ignored options. But otherwise, good work.

@bartlomieju bartlomieju changed the title [WIP] chore: Implement strict mode chore: Implement strict mode May 26, 2019

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented May 26, 2019

@kitsonk I did as you suggested.

It's worth noting that there is still a lot of places with any types ignored by eslint, but I'm sure we can tackle that gradually in separate PRs.

Kudos to @zekth for a lot of help

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented May 27, 2019

Let's wait for #444 before landing this PR

@ry

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

LGTM but holding for #444

bartlomieju added some commits May 30, 2019

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented May 30, 2019

@ry I updated this PR after #444, PTAL

@@ -37,4 +37,4 @@ jobs:
- bash: echo "##vso[task.prependpath]C:\Users\VssAdministrator\.deno\\bin"
- bash: npx eslint **/*.ts --max-warnings=0
- bash: deno.exe run --allow-run --allow-write --allow-read format.ts --check
- bash: deno.exe run --allow-run --allow-net --allow-write --allow-read test.ts
- bash: deno.exe run --allow-run --allow-net --allow-write --allow-read --config=tsconfig.test.json test.ts

This comment has been minimized.

Copy link
@ry

ry May 30, 2019

Contributor

Why is the --config flag being added here?

This comment has been minimized.

Copy link
@bartlomieju

bartlomieju May 30, 2019

Author Contributor

Well I tried using strict mode in linter but it was not making any difference. So I explicitly tell Deno's TS compiler to use strict mode.

@@ -26,7 +26,7 @@ jobs:
- script: echo '##vso[task.prependpath]$(HOME)/.deno/bin/'
- script: eslint **/*.ts --max-warnings=0
- script: deno run --allow-run --allow-write --allow-read format.ts --check
- script: deno run --allow-run --allow-net --allow-write --allow-read test.ts
- script: deno run --allow-run --allow-net --allow-write --allow-read --config=tsconfig.test.json test.ts

This comment has been minimized.

Copy link
@ry

ry May 30, 2019

Contributor

We need to de-dup these commands at some point...

Probably we should try to copy how Tokio uses Azure Pipelines

This comment has been minimized.

Copy link
@bartlomieju

bartlomieju May 30, 2019

Author Contributor

Definitely, I'll do that in followup PR

@ry

ry approved these changes May 30, 2019

Copy link
Contributor

left a comment

LGTM - thanks - this is great to have.

@ry ry merged commit be24677 into denoland:master May 30, 2019

5 checks passed

denoland.deno_std Build #20190530.5 succeeded
Details
denoland.deno_std (Linux) Linux succeeded
Details
denoland.deno_std (Mac) Mac succeeded
Details
denoland.deno_std (Windows) Windows succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@bartlomieju bartlomieju deleted the bartlomieju:chore-strict_tsconfig branch May 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.