tsconfig

tsconfig.json typeroots custom path not picked up

怎甘沉沦 提交于 2021-02-18 20:59:40
问题 I have some custom .d.ts files and I want tsc to pick up these files when compiling. In order to get this done I modify the tsconfig.file to include the following "typeRoots": [ "../node_modules/@types", "./app/modules" ] ./app/modules is where my custom .d.ts file resides. Inside the ./app/modules folder I have the following file myModule.d.ts export declare module myModule { function Login(); function Logout(); } Now inside my other typescript file I have the following import import {

Problem with Visual Studio Code using “react-jsx” as jsx value with create-react-app

不羁岁月 提交于 2021-02-15 12:07:13
问题 I'm struggling with following "error" in VSCode : Argument for '--jsx' option must be: 'preserve', 'react-native', 'react' Hence, react-scripts (create-react-app) automatically sets the jsx key to react-jsx value, when react value seems to work. Actually, the code works perfectly and displays the page I want, but the IDE is underlining kinda everything as errors, saying : Cannot use JSX unless the '--jsx' flag is provided. Here is my tsconfig.json : { "compilerOptions": { "target": "es5",

Problem with Visual Studio Code using “react-jsx” as jsx value with create-react-app

时光毁灭记忆、已成空白 提交于 2021-02-15 12:03:21
问题 I'm struggling with following "error" in VSCode : Argument for '--jsx' option must be: 'preserve', 'react-native', 'react' Hence, react-scripts (create-react-app) automatically sets the jsx key to react-jsx value, when react value seems to work. Actually, the code works perfectly and displays the page I want, but the IDE is underlining kinda everything as errors, saying : Cannot use JSX unless the '--jsx' flag is provided. Here is my tsconfig.json : { "compilerOptions": { "target": "es5",

skip library check only in node_modules

喜夏-厌秋 提交于 2021-02-07 11:17:00
问题 There are several questions about disabling errors in mistyped node_modules (e.g., this one, or this one), but they all involve using the skipLibCheck compiler flag. Are there other solutions to this problem (e.g., using include or exclude )? I have a couple of hand-written .d.ts files (stricter types than available on DefinitelyTyped) that I'd like to type check, so the wholesale disabling of typechecking on these files is not appealing. 回答1: There is no granular control over type checking,

skip library check only in node_modules

谁说胖子不能爱 提交于 2021-02-07 11:16:29
问题 There are several questions about disabling errors in mistyped node_modules (e.g., this one, or this one), but they all involve using the skipLibCheck compiler flag. Are there other solutions to this problem (e.g., using include or exclude )? I have a couple of hand-written .d.ts files (stricter types than available on DefinitelyTyped) that I'd like to type check, so the wholesale disabling of typechecking on these files is not appealing. 回答1: There is no granular control over type checking,

How to force tsc to ignore node_modules folder?

≯℡__Kan透↙ 提交于 2021-02-05 20:41:59
问题 I'm using tsc build tasks. Unfoutunately I'm always getting the same errors from the node modules folder Executing task: .\node_modules\.bin\tsc.cmd --watch -p .\tsconfig.json < node_modules/@types/node/index.d.ts(6208,55): error TS2304: Cannot find name 'Map'. node_modules/@types/node/index.d.ts(6215,55): error TS2304: Cannot find name 'Set'. node_modules/@types/node/index.d.ts(6219,64): error TS2304: Cannot find name 'Symbol'. node_modules/@types/node/index.d.ts(6225,59): error TS2304:

How to force tsc to ignore node_modules folder?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 20:41:07
问题 I'm using tsc build tasks. Unfoutunately I'm always getting the same errors from the node modules folder Executing task: .\node_modules\.bin\tsc.cmd --watch -p .\tsconfig.json < node_modules/@types/node/index.d.ts(6208,55): error TS2304: Cannot find name 'Map'. node_modules/@types/node/index.d.ts(6215,55): error TS2304: Cannot find name 'Set'. node_modules/@types/node/index.d.ts(6219,64): error TS2304: Cannot find name 'Symbol'. node_modules/@types/node/index.d.ts(6225,59): error TS2304:

Transpile to ES5 corrupt JS library in Angular 6 project

巧了我就是萌 提交于 2021-02-05 09:35:24
问题 I am trying to use Dygraph library in an Angular 6 project. It works perfectly in Chrome / FF, however it does not work in IE11. I installed the library through npm, and installed the @types from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dygraphs I imported the library in my module using: import { default as Dygraph } from 'dygraphs'; When I open the page on IE11, loading stops on: this.xticks.push({pos, label, has_tick}); With error SCRIPT1003: Expected ':'. . The

Typescript configuration: is module setting case sensitive?

落花浮王杯 提交于 2021-01-29 14:27:55
问题 I've got a question coming from the following two tsconfig.json files, they're in the same project, one extends the other: Parent { "compilerOptions": { "experimentalDecorators": true, "skipLibCheck": true, "module": "ESNext" } // ... Child { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "module": "esNext", }, // ... } It's unclear: is the module param case sensitive? a setup like this, with a child config extending the parent, same module type, but with

tsconfig.json ignored by Visual Studio Code

烂漫一生 提交于 2021-01-29 03:10:49
问题 I have a tsconfig.json file at the root of my project: { "compilerOptions": { "target": "ES5", "module": "commonjs", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "noEmitHelpers": true, "baseUrl": ".", "paths": { "services/*": ["./src/app/shared/services/*"] } }, "compileOnSave": false, "buildOnSave": false, "awesomeTypescriptLoaderOptions": { "forkChecker": true, "useWebpackText": true } } I am trying to define my paths so we don't need to use relative