tsconfig

Why does TFS 2017 Sonar Build Definition gives No valid rules have been specified error?

懵懂的女人 提交于 2019-12-11 04:08:29
问题 I have a TFS 2017 Build definition created for HTML (TypeScript,Javascript) which executes the sonar task and after executing the sonar build definition, i get the Error: No valid rules have been specified message displayed in my build summary. This error get created during Run Code Analysis task in build definition. I did tried googling for the error and found this link enter link description here on Stack Overflow enter link description here on GitHub Where they have advice to add jsRules

Where to specify delete-output-path?

瘦欲@ 提交于 2019-12-10 23:40:25
问题 I have a Node Express project with Angular added through Angular CLI, ie ng new . I do not want the Angular output to wipe out the distribution folder. I understand there is a delete-output-path parameter that can be put on the command line to ng build . Is it possible to put this in angular-cli.json ? Or should it be in tsconfig.json ? Under which property? 回答1: Yes, you can. You have to put it under defaults property of .angular-cli.json like this: { "$schema": "./node_modules/@angular/cli

Share interfaces between separat TypeScript projects

倾然丶 夕夏残阳落幕 提交于 2019-12-10 19:28:06
问题 tl;dr at the bottom I've got a webserver written in TypeScript and a client SPA written in TypeScript. My idea was to share interfaces for request and response data to take full advantage of "type-safety". My big problem is that client and server are sibling folders each with its own package.json, tsconfig.json, src-dir etc. What I want to have is something like this: server/ ├── src/ ├── build/ ├── tsconfig.json └── package.json client/ ├── src/ ├── build/ ├── tsconfig.json └── package.json

Typescript 3 project reference with third party library (from npm)

假装没事ソ 提交于 2019-12-10 10:57:37
问题 I am using Typescript and am trying to build a background sync with service worker. Someone suggested I should do this: You can split your project into multiple parts with separate tsconfig.json files: one part that includes the dom lib and one part that includes the webworker lib. You can make another part for common code that doesn't depend on either library. You can use project references to help automate the build. If this doesn't fully solve the problem, please update the question to

Why is ES7/array polyfill needed despite the tsconfig target is set to ES5

眉间皱痕 提交于 2019-12-10 10:14:28
问题 I have the following settings in the tsconfig.json . I added "es2017" to use Array.includes .: { "compilerOptions": { "lib": [ "es6", "es2017", "dom" ], "module": "es6", "target": "es5" } } Now, I realized, that I have to add import 'core-js/es7/array'; to the polyfills.ts , to use Array.includes also for the Internet Explorer 11. The target in the tsconfig.json is set to es5 , which does not have Array.includes . Why do I need to add the polyfill? 回答1: TypeScript does not auto-polyfill code.

getting nyc/istanbul coverage report to work with typescript

风流意气都作罢 提交于 2019-12-09 15:28:17
问题 I'm struggling to get proper coverage with nyc/istanbul for my typescript/mocha/gulp project. I've tried a number of approaches, some of them seem to be unable to use source maps and other fails due to ts-node / tsc errors. My current setup is: nyc relevant config in package.json "scripts": { "test:coverage": "nyc npm run test:unit", "test:unit": "gulp mocha" } "nyc": { "check-coverage": true, "all": true, "extension": [ ".js", ".jsx", ".ts", ".tsx" ], "include": [ "src/**/!(*.test.*).[tj]s?

Warning: Cannot find parent tsconfig.json

左心房为你撑大大i 提交于 2019-12-09 14:14:22
问题 I would like to fix the warning: Warning: Cannot find parent tsconfig.json in the TypeScript Errors tab in IntelliJ IDEA 2016.3 . My TypeScript code lives in the src directory and my TypeScript output is going to lib as expected without the src folder being added to lib . I consume the lib folder in other projects and it seems to work as expected. So this doesn't seem to be a big problem, but I occasionally have a problem with TSLint where it sometimes does not seem to pick up a .tsx file is

Best practice to setup tsconfig “files” vs “include”?

久未见 提交于 2019-12-08 19:18:54
问题 I was wondering what is better and what are the pros and cons of using "files" vs "include" in tsconfig? I don't really like the include pattern because is just including all ts files in the src folder, and I might now want that. I like the "files" approach, because I can point to the entry file and just load everything that file needs. I'm using typescript with webpack. I guess the entry point is defined in webpack so there is no need to define in typescript as well? I tried to use "files"

error TS2300: Duplicate identifier 'PropertyKey' in node_modules/@types/core-js/index.d.ts

人盡茶涼 提交于 2019-12-08 18:53:37
问题 I have these errors in node_modules/@types/core-js/index.d.ts in Visual Studio Code IDE: When I run npm start to serve the app, I get: node_modules/@types/core-js/index.d.ts(21,14): error TS2300: Duplicate identifier 'PropertyKey'. node_modules/@types/core-js/index.d.ts(85,5): error TS2687: All declarations of 'name' must have identical modifiers. node_modules/@types/core-js/index.d.ts(145,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol

tsconfig.json not used by TypeScript compiler?

人盡茶涼 提交于 2019-12-07 21:00:36
问题 I'm new to TypeScript. I am trying to setup the use of it in WebStorm. I have created a tsconfig.json file in the root of my project and changed the builtin ts compiler to version 1.6.2. Still I need to include reference paths in every ts file. I hoped this would not be needed anymore once I defined the tsconfig.json file. I tried to isolate the issue and went testing outside WebStorm. The issue remains. This is my setup: I installed TypeScript with "npm install -g typescript". I created a