Tsdx: vscode doesn't use tsconfig.json settings for files in test folder

Created on 5 May 2019  路  3Comments  路  Source: formium/tsdx

Current Behavior

When I set experimentalDecorators to true in tsconfig.json it works ok for files in "src", but it doesn't work for files in "test" (vscode marks decorators in red, but it works ok when running 'test')

Desired Behavior

When experimentalDecorators is set to true in tsconfig.json it should also be for vscode test files

Suggested Solution

Add a tsconfig.json file to the tests folder:
{ "extends": "../tsconfig.json", "include": ["."] }
with any other overrides that might be needed to make tests work and make jest use that one.

Who does this impact? Who is this for?

Libs that use experimental decorators

Describe alternatives you've considered

N/A

Additional context

N/A

feature

Most helpful comment

One way I found to fix this was including the following tsconfig.json inside the tests folder

{
  "extends": "../tsconfig.json",
  "include": ["."]
}

All 3 comments

Ok, apparently as of v0.5.7 decorators do work for tests and builds, but vscode complains when they are used inside tests

One way I found to fix this was including the following tsconfig.json inside the tests folder

{
  "extends": "../tsconfig.json",
  "include": ["."]
}

I think #225 ended up duplicating this and #226 fixed it in the templates. Though this is a great workaround

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vberlier picture vberlier  路  5Comments

NateRadebaugh picture NateRadebaugh  路  3Comments

rockmandash picture rockmandash  路  5Comments

JasonEtco picture JasonEtco  路  6Comments

agentofuser picture agentofuser  路  3Comments