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

Stryker 4.0 with typescript and @ts-expect-error reports: "Unused '@ts-expect-error' directive." #2364

Closed
nicojs opened this issue Aug 7, 2020 · 0 comments · Fixed by #2365
Labels
🐛 Bug Something isn't working
Milestone

Comments

@nicojs
Copy link
Member

nicojs commented Aug 7, 2020

When stryker adds the header // @ts-nocheck to typescript files, it can have the undesired side effect of actually reporting errors when a @ts-expect-error is found somewhere.

microsoft/TypeScript#39427

@nicojs nicojs added the 🐛 Bug Something isn't working label Aug 7, 2020
@nicojs nicojs added this to the 4.0 milestone Aug 7, 2020
nicojs added a commit that referenced this issue Aug 9, 2020
Strip comments of JavaScript and friend files in the sandbox. This will make sure no `// @ts-expect-error` or `// @ts-check` comments survive, as they break typescript compilation. You can configure this behavior.

```js
{
  "sandbox": {
    "stripComments": "**/*+(.js|.ts|.cjs|.mjs)?(x)"
  }
}
```

You can disable this behavior by setting `stripComments` to `false`.

Adds a dependency on `strip-comments`, seems like a legit way of stripping comments.

Rename `sandboxFileHeaders` to `sandbox.fileHeaders` to be in line with this sandbox options collection.

Fixes #2364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant