tsconfig

After upgrading from Angular 7 to Angular 8 my pipe test stopped to work: TypeError: undefined is not iterable

拈花ヽ惹草 提交于 2020-07-10 03:10:29
问题 I am using Jest to unit test my Angular8 components. I performed upgrade from A7 where the tests passed. Now I get an error: FAIL src/app/core/pipes/client/client.pipe.spec.ts (21.395s) ● ClientPipe › should format person TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) 10 | export class ClientPipe implements PipeTransform { 11 | > 12 | constructor( | ^ 13 | private readonly personPipe: PersonPipe, 14 | private readonly organizationPipe: OrganizationPipe) {}

How to use different tsconfig file for test files in vscode?

Deadly 提交于 2020-07-09 03:20:30
问题 This question is similar to this question: How to use different tsconfig file for tests? But I am asking for visual studio code. I have two tsconfig files: tsconfig.json for all application files tsconfig.test.json for all test files tsconfig.json excludes all *.spec.ts while tsconfig.test.json only includes these files. How can I make visual studio code to understand that an opened .spec.ts file belongs to tsconfig.test.json ? I dont want to separate all my tests into an own test directory

How to set paths property in a project with multiple tsconfig.json?

六眼飞鱼酱① 提交于 2020-06-27 07:04:30
问题 I have the following file structure |__ app1/ | |__ tsconfig.json |__ utilities/ | |__ files.ts |__ base-tsconfig.json In base-tsconfig.json I have set the paths property as following "compilerOptions": { "baseUrl": ".", "paths": { "utils/*": ["utilities/*"] } } and in tsconfig.json it looks as follow { "extends": "../base-tsconfig", } That should be enough right? I am still getting below message though. Cannot find module 'utils' 回答1: The "paths" option can be used to inform the compiler of

Angular Typescript - exclude is not working in tsconfig.json

喜夏-厌秋 提交于 2020-05-25 17:20:41
问题 Currently I am facing issue with one of the modules inside node_modules while r compiling the Angular 4 Project and the getting the error as below hence I decided to exclude this project in the tsconfig.json but still I am getting the error, Can someone help me here ERROR in D:/workspace/demo/node_modules/@types/d3-collection/index.d.ts (148,23): ',' expected. ERROR in D:/workspace/demo/node_modules/@types/d3-collection/index.d.ts (483,40): ',' expected. ERROR in D:/workspace/demo/node

Monorepo with `rootDirs` produces unwanted sudirectories such as `src` in `outDir`

百般思念 提交于 2020-05-16 14:01:14
问题 I am planning a monorepo typescript porject like below: / (root) +--backend/ | +-src/ | \-tsconfig.json +--shared/ | \-src/ \--frontend/ \-src/ tsconfig.json is defined like below: { "compilerOptions": { "target": "es5", "module": "commonjs", "outDir": "./dist", "strict": true, "baseUrl": "./src", "paths": { "shared": [ "../../shared/src" ] }, "rootDirs": [ "./src", "../shared/src" ], "esModuleInterop": true } } When I execute tsc under backend it gives me like below: / (root) +-backend/ +

Monorepo with `rootDirs` produces unwanted sudirectories such as `src` in `outDir`

耗尽温柔 提交于 2020-05-16 13:58:31
问题 I am planning a monorepo typescript porject like below: / (root) +--backend/ | +-src/ | \-tsconfig.json +--shared/ | \-src/ \--frontend/ \-src/ tsconfig.json is defined like below: { "compilerOptions": { "target": "es5", "module": "commonjs", "outDir": "./dist", "strict": true, "baseUrl": "./src", "paths": { "shared": [ "../../shared/src" ] }, "rootDirs": [ "./src", "../shared/src" ], "esModuleInterop": true } } When I execute tsc under backend it gives me like below: / (root) +-backend/ +

Angular 6 / declare path for library in tsconfig.lib.json

笑着哭i 提交于 2020-05-15 02:16:08
问题 I'm trying to configure the paths for an Angular 6 library (I have successfully configured the paths for a previous Angular project) Here is what is working for my previous app in the tsconfig.json file: "compilerOptions": { [...] "baseUrl": "src", "paths": { "@class/*": [ "app/class/*" ], "@services/*": [ "app/services/*" ], "@views/*": [ "app/views/*" ] } } and then use it like for example: Import { Item } form '@class/item'; In my new app I'm trying the same way in the tsconfig.**lib**

Create react app typescript does not load d.ts file

梦想与她 提交于 2020-01-24 06:56:05
问题 I have created a project using create react app typescript. I have a few d.ts files where I have defined interfaces types and enums. When I run start script. It is not able to load the d.ts files. following is my tsconfig file. { "compilerOptions": { "target": "es6", "lib": [ "dom", "dom.iterable", "es2017" ], "allowJs": true, "skipLibCheck": false, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": false, "forceConsistentCasingInFileNames": true, "module": "esnext",

Visual Studio 2017, JavaScript intellisense inconsistencies

拟墨画扇 提交于 2020-01-13 08:20:30
问题 TL;DR : How do you include a tsconfig.json file in Visual Studio 2017 and still have JavaScript intellisense work like it does by default, giving code hints both for your own code and 3rd-party libraries? Is it borked, or do I just need a better understanding of how it works? Much like jQuery, I would like ubiquitous access to my own JavaScript namespaces across JavaScript and html files with intellisense. How does one achieve this? EDIT 3 : I reported this issue on developercommunity

How can I setup my VS 2013 TypeScript project to compile my typescript files but exclude my node_modules?

蓝咒 提交于 2020-01-12 07:31:10
问题 I'm working on an angular2@beta project in VS 2013 after familiarizing myself with it in IntelliJ. IntelliJ can be set to find the tsconfig.json file and, as of TypeScript 1.6, it can therefore read the "exclude" property and not attempt to compile any of the node_modules. Now that I've moved to VS 2013 with TypeScript 1.7, I'm running into the issue where it's trying to compile the node_modules. I've included the tsconfig.json, but from what I've read, tsconfig.json is fully supported only