tsc

How to make Typescript transpile my Sequelize model?

假如想象 提交于 2021-02-11 14:25:19
问题 After transpiling the code using the command "yarn tsc", I tried to execute my code and got the error in the image below. When I went to check the reason for the error, I saw that my Sequelize model classes are not being stacked, they are empty. I couldn't find explanations anywhere about the reason for this, nor in the Sequelize documentation. Could anyone help? My dependencies "dependencies": { "@babel/plugin-proposal-class-properties": "^7.8.3", "@types/bcrypt": "^3.0.0", "@types/cors": "

“npx tsc --version” reports different TypeScript version inside virtual machine

ぃ、小莉子 提交于 2021-02-09 02:57:48
问题 I want to be able to run npx tsc on my project on both my host + guest operating systems. But the guest is using a different (older) version of tsc - and I'm not sure where it's coming from. My setup: Host OS: Windows 10 Guest OS: Debian 9 I'm using VirtualBox, and the guest is mounting the host's files using VirtualBox's "shared folders" feature - so it doesn't have a separate copy of the project files - my project is accessed through shared folders at all times. I do NOT have Typescript

“npx tsc --version” reports different TypeScript version inside virtual machine

…衆ロ難τιáo~ 提交于 2021-02-09 02:56:09
问题 I want to be able to run npx tsc on my project on both my host + guest operating systems. But the guest is using a different (older) version of tsc - and I'm not sure where it's coming from. My setup: Host OS: Windows 10 Guest OS: Debian 9 I'm using VirtualBox, and the guest is mounting the host's files using VirtualBox's "shared folders" feature - so it doesn't have a separate copy of the project files - my project is accessed through shared folders at all times. I do NOT have Typescript

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:

Compile typescript project as local module

。_饼干妹妹 提交于 2021-01-27 21:11:27
问题 tl;dr Can I have typescript compile different folders as separate libraries, and import the results like a node module? For example, I have a common folder with 800 files, and then a few app folders ( app1 , app2 , etc) each with 20+/- files. All of the app folders have references to classes/interfaces/etc inside of the common folder. The problem is that whenever I compile an app folder it also compiles all 800 of the common files. This compilation takes too long and I'd really like to avoid

What are the correct typescript compiler (tsc) options to set in order to separate main from test compilation?

吃可爱长大的小学妹 提交于 2021-01-27 12:34:42
问题 NB: A public git repo for this question is at https://github.com/matthewadams/ts-test if you want to have a look at the full project. I'm trying to separate main source compilation from test source compilation in my project. Here's the source directory structure: src main ...typescript source files and possibly child directories with sources test unit ...unit test sources integration ...integration test sources My goal is to compile only main sources into lib/main , and only test sources into

How do I compile Typescript at Heroku postinstall?

无人久伴 提交于 2020-12-29 09:34:03
问题 Instead of uploading the precompiled dist directory, I want to compile src at server side instead. Here are my scripts inside package.json: "scripts": { "test": "echo \"No test specified\" && exit 0", "start": "node dist/app.js", "postinstall": "tsc" } Here are the dependencies: "dependencies": { "@types/express": "^4.11.1", "@types/pg": "^7.4.4", "@types/socket.io": "^1.4.31", "body-parser": "^1.18.2", "express": "^4.16.2", "pg": "^7.4.1", "socket.io": "^2.0.4", "tslint": "^5.9.1",

Type for non-falsy, aka truthy

拜拜、爱过 提交于 2020-12-26 05:21:11
问题 In TypeScript, is there a type for truthy? I have this method: Object.keys(lck.lockholders).length; enqueue(k: any, obj?: any): void think with TS there is a way to check for empty strings '', by the way. and I want to convert it to: enqueue(k: Truthy, obj?: any): void except I don't know how to define the type for Truthy. I think with TS there is a way to check for empty strings '', by the way. The reason I want this is because I don't want users to pass in null , undefined , '' , etc, as

Type for non-falsy, aka truthy

99封情书 提交于 2020-12-26 05:18:45
问题 In TypeScript, is there a type for truthy? I have this method: Object.keys(lck.lockholders).length; enqueue(k: any, obj?: any): void think with TS there is a way to check for empty strings '', by the way. and I want to convert it to: enqueue(k: Truthy, obj?: any): void except I don't know how to define the type for Truthy. I think with TS there is a way to check for empty strings '', by the way. The reason I want this is because I don't want users to pass in null , undefined , '' , etc, as