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(core): strip comments in sandbox #2365

Merged
merged 3 commits into from
Aug 9, 2020

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Aug 7, 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.

{
  "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

* `sandboxFileHeaders` -> `sandbox.fileHeaders`
* `sandboxStripComments` -> `sandbox.stripComments`
@nicojs nicojs changed the title feat(core): allow strip comments in sandbox feat(core): strip comments in sandbox Aug 8, 2020
@nicojs nicojs merged commit 55f27f2 into epic/mutation-switching Aug 9, 2020
@nicojs nicojs deleted the feat/strip-comments branch August 9, 2020 11:58
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.

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