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

feat(disableTypeChecks): add option 'true' to disable all type checks #3765

Merged
merged 4 commits into from
Oct 28, 2022

Conversation

simondel
Copy link
Member

@simondel simondel commented Oct 3, 2022

Fixes #3741

Adds option 'true' to the disableTypeChecks config option to disable all type checks

Copy link
Member

@nicojs nicojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty elegant. But it is not working.

If you change this:

diff --git a/e2e/test/typescript-transpiling/stryker.conf.json b/e2e/test/typescript-transpiling/stryker.conf.json
index 77b352b0..b7fdea85 100644
--- a/e2e/test/typescript-transpiling/stryker.conf.json
+++ b/e2e/test/typescript-transpiling/stryker.conf.json
@@ -8,6 +8,7 @@
   "checkers": ["typescript"],
   "tsconfigFile": "tsconfig.json",
   "buildCommand": "npm run build",
+  "disableTypeChecks": true,
   "plugins": [
     "@stryker-mutator/mocha-runner",
     "@stryker-mutator/typescript-checker"

And run npm test there you get a bunch of these warnings:

07:52:14 (9921) WARN DisableTypeChecksPreprocessor Unable to disable type checking for file "/home/nicojs/github/stryker-js/e2e/test/typescript-transpiling/package.json". Shouldn't type checking be disabled for this file? Consider configuring a more restrictive "disableTypeChecks" settings (or turn it completely off with `false`) Error: Unable to parse /home/nicojs/github/stryker-js/e2e/test/typescript-transpiling/package.json. No parser registered for .json!

I think we should silently ignore files that cannot be parsed from packages/instrumenter/src/disable-type-checks.ts, that makes the most sense 🤷‍♀️

Maybe we want to create an e2e test for it? Or change one of our e2e tests to use true and verify no warnings are logged.

docs/configuration.md Outdated Show resolved Hide resolved
packages/core/src/config/file-matcher.ts Outdated Show resolved Hide resolved
packages/core/src/config/file-matcher.ts Outdated Show resolved Hide resolved
@nicojs
Copy link
Member

nicojs commented Oct 11, 2022

@simondel are you planning to pick up the last remark as well? 😇

@nicojs nicojs self-requested a review October 28, 2022 11:45
@nicojs nicojs enabled auto-merge (squash) October 28, 2022 11:46
@nicojs
Copy link
Member

nicojs commented Oct 28, 2022

I've implemented it during hacktoberfest 🐱‍👤

@nicojs nicojs merged commit 3c3d298 into master Oct 28, 2022
@nicojs nicojs deleted the feature/3741-disabletypechecks branch October 28, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support true for disableTypeChecks
2 participants