tsconfig

TypeScript error: “Cannot find name” in Visual Studio

China☆狼群 提交于 2019-12-12 18:29:56
问题 I've seen a lot of threads and discussions about that but I'm not getting to fix the issue. This is my post from some days ago. One of the purposes of typings is to avoid the use of <reference> tags, right? But if I don't use it, Visual Studio complains: Visual Studio stops complaining once I reference browser.d.ts . Here is my tsconfig : { "compilerOptions": { "noImplicitAny": false, "noEmitOnError": true, "removeComments": false, "sourceMap": true, "target": "es5" }, "files": [ ], "exclude"

Typescript paths not resolving

别来无恙 提交于 2019-12-12 17:34:50
问题 Here's the Github MCVE showing an issue. npm run compile shows the error. I'm trying to do this: import {Todo} from '@test'; But it's not resolving. src/index.ts:1:20 - error TS2307: Cannot find module '@test'. I have paths in tsconfig.json . "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ "paths": { "@fs/": ["src/"], "@test/": ["test/"] }, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ Thoughts? Github Typescript

What does “No valid rules have been specified for JavaScript files” mean?

让人想犯罪 __ 提交于 2019-12-12 13:20:35
问题 I have a React - Typescript created with: create-react-app my-app --scripts-version=react-scripts-ts It compiles fine, but every time I see this message or warning: No valid rules have been specified for JavaScript files Any ideas how to get rid of it? > react-scripts-ts build Creating an optimized production build... Starting type checking and linting service... Using 1 worker with 2048MB memory limit ts-loader: Using typescript@2.8.3 and /Users/julian/my-app/tsconfig.json No valid rules

Empty comments in Angular application

流过昼夜 提交于 2019-12-12 12:35:23
问题 Is there any configuration setting which would remove these empty comments and whitespace? My build command is ng build --environment prod --progress false --target production and tsconfig is: { "compileOnSave": false, "compilerOptions": { "alwaysStrict": true, "baseUrl": "/", "emitDecoratorMetadata": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, "lib": [ "es2015", "dom" ], "module": "es2015", "moduleResolution": "node", "newLine": "CRLF",

How to Target ES6 for Server and ES5 for Client

人走茶凉 提交于 2019-12-12 12:32:49
问题 I am creating a project with node on the server and Angular 2 on the client. I want to use Typescript across the entire project. I would like to target ES6 for the server, since node supports it, but ES5 for the client. Currently my directory structure looks something like this. ├── app.js ├── something.js ├── tsconfig.json ├── wwwroot │ ├── index.html │ ├── main.ts │ ├── components │ │ ├── mycomponent.ts I want everything above wwwroot to target ES6, but everything inside of wwwroot to

Cannot choose text style in RTE

流过昼夜 提交于 2019-12-12 01:45:29
问题 In the Page TSConfig on the root page I have the following code: ///////////////////////////////////////////////////////////// // RTE ///////////////////////////////////////////////////////////// RTE.classes{ highlight{ name = highlight value = color:#636466; font-size:15px; } brown{ name = braun value = color:#9A3811; } } RTE.default{ ignoreMainStyleOverride = 1 useCSS = 1 contentCSS = fileadmin/templates/css/rte.css classesCharacter := addToList(highlight, brown) classesParagraph :=

How to setup 'tsconfig.json' to build files in 'project/src' and write output to 'project/lib'?

梦想与她 提交于 2019-12-11 13:46:28
问题 I tried using the following in my tsconfig.json file: ... "declaration": true, "rootDir": "./src/", "outDir": "./lib/", ... The first time I execute tsc it seems to work fine; but the second time I execute tsc I get an error where tsc complains that it cannot write output because it would overwrite an input file. It seems that tsc is trying to include the TypeScript declaration files that are written out to my 'lib' directory. 回答1: Just exclude the files in the lib folder: { "compilerOptions"

tsconfig.js exclude property not working when import modules is used

删除回忆录丶 提交于 2019-12-11 08:17:16
问题 I am going nuts currently why my typescript compilation (tsc) is always trying to compile node_modules files even when I've specified to exclude this folder. [ tl;dr; : it's because I have imports but I don't know how to exclude imports from compilation ] I'm using Visual Studio Code, but have the same issue when running tsc directly from commandline My project structure is a typical one : . | --node_modules\.. | --src\.. | --typings In my root I have a tsconfig.json with following content: {

Resolving paths in TypeScript outDir

自闭症网瘾萝莉.ら 提交于 2019-12-11 06:10:02
问题 I'm writing a UI page object model testing project in TypeScript and I'm trying my best to avoid hideous nested imports. I found the paths object for the .tsconfig file that fixes the issue in .ts files, but, because I compile into an outDir , my compiled .js files cannot resolve the module path. I develop in a model directory and compile into a src directory. I've set up my .tsconfig file as follows { "compilerOptions": { "target": "es6", "module": "commonjs", "moduleResolution": "node",

Typo3 CKEditor image from FAL

半世苍凉 提交于 2019-12-11 04:19:55
问题 I set up a fresh TYPO3 8.7.4 installation with CKEditor and rte_ckeditor_image to get images from FAL. In the documentation from rte_ckeditor_image it says: The maximum dimensions relate to the configuration for magic images which have to be set in Page TSConfig: # Page TSConfig RTE.default.buttons.image.options.magic { maxWidth = 1020 # Default: 300 maxHeight = 800 # Default: 1000 } I did this, but still I can't make the width of an image bigger than 300px. I looked at the source code from